stream to list in java code example
Example 1: java stream to list
List<String> temp = toCheck.stream().map((a -> a.getFoo())).collect(Collectors.toList());
Example 2: stream to list
.collect(Collectors.toList());
Example 3: java streams
Arrays.asList("a1", "a2", "a3")
.stream()
.findFirst()
.ifPresent(System.out::println); // a1