Imagine that I have a list of certain objects:
List
And I need to generate another list including the ids of
ids
Java 8 lambda expression solution:
List iDList = students.stream().map((student) -> student.getId()).collect(Collectors.toList());