Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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