Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Map<Artist, Long> filter(){
- Map<Artist, List<Concert>> raport = concerts.findAll().stream()
- .collect(Collectors.groupingBy(Concert::getArtist));
- Map<Artist, Long> raportt = raport.entrySet().stream()
- .map(a -> new AbstractMap.SimpleEntry<Artist, Long>(a.getKey(), a.getValue().stream().count()))
- .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
- return raportt;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement