java stream get field from object code example
Example: java stream get list of one field
List<String> names =
personList.stream()
.map(Person::getName)
.collect(Collectors.toList());
List<String> names =
personList.stream()
.map(Person::getName)
.collect(Collectors.toList());