Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Last active December 19, 2015 16:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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