Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Optional<Integer> minAge = person
.map(p -> p.getAge()) // return Stream<Integer>
.filter(age -> age > 20) // return Stream<Integer>
.min(Comparator.naturalOrder()); // terminal operation
.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