Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Optional<Integer> minAge = person
.stream()
.map(p -> p.getAge()) // return Stream<Integer>
.filter(age -> age > 20) // return Stream<Integer>
.min(Comparator.naturalOrder()); // terminal operation
people.stream()
.map(p -> p.getLastname())
.allMatch(length < 10); // terminal operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.