Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Last active May 20, 2016 13:00
Show Gist options
  • Save iyengarajay/7048b376e6bbf9bdf201d95c534f4383 to your computer and use it in GitHub Desktop.
Save iyengarajay/7048b376e6bbf9bdf201d95c534f4383 to your computer and use it in GitHub Desktop.
public List<String> getNamesOfUKCitizens()
{
return persons.stream()
.filter( p -> p.getCitizenship() == Citizenship.UK)
.map(p -> p.getName())
.collect(Collectors.toList());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment