Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Last active May 20, 2016 12:59
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 iyengarajay/5aa312b9aed1920ded7497f2650553af to your computer and use it in GitHub Desktop.
Save iyengarajay/5aa312b9aed1920ded7497f2650553af to your computer and use it in GitHub Desktop.
public List<String> getNamesOfUKCitizens()
{
Function<Person,String> mapper = p -> p.getName();
return persons.stream()
.filter( p -> p.getCitizenship() == Citizenship.UK)
.map(mapper)
.collect(Collectors.toList());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment