Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Created May 20, 2016 14:34
Show Gist options
  • Save iyengarajay/c2406adf36b639d7b87368cc4aa46fe1 to your computer and use it in GitHub Desktop.
Save iyengarajay/c2406adf36b639d7b87368cc4aa46fe1 to your computer and use it in GitHub Desktop.
return leagues.stream()
.filter(league -> league.getLeagueName() == LeagueName.PREMIER_LEAGUE)
.flatMap(league ->league.getPlayers().stream())
.filter(player -> player.getAge() <=25)
.map(player ->player.getName())
.sorted(Comparator.naturalOrder())
.collect(Collectors.joining(","));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment