collect to list java 8 code example
Example 1: java stream to list
List<String> temp = toCheck.stream().map((a -> a.getFoo())).collect(Collectors.toList());
Example 2: java collection to list
List theList = new ArrayList(coll);
List<String> temp = toCheck.stream().map((a -> a.getFoo())).collect(Collectors.toList());
List theList = new ArrayList(coll);