Skip to content

Instantly share code, notes, and snippets.

@akshanshjain95
Created June 26, 2019 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshanshjain95/9b88a003426a14b4b4fb1fea5818cd22 to your computer and use it in GitHub Desktop.
Save akshanshjain95/9b88a003426a14b4b4fb1fea5818cd22 to your computer and use it in GitHub Desktop.
private long numberOfPeopleNamedJohn(List<Person> people) {
List<Person> localPeople = new ArrayList<>();
localPeople.addAll(people);
return localPeople.stream().filter(person -> person.getFirstName().equals("John")).count();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment