Created
April 16, 2018 05:45
-
-
Save exhesham/84a2ba9f3851da5821dae4f27bbb89cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Predicate<Person> isAnAdult = person -> person.getAge() >= 18; | |
List<Person> people = getAllPeople(); | |
Integer nrOfAdults = people.stream() .filter(isAnAdult).count(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment