7

Colleague (Lead Engineer): Hey, check my code. I'm trying to group a list of Request objects by their id. Something is not working here

Me: * saw his code, had a lot of shitty loops, called all for a quick meet, changed his shitty mess to one liner

list.stream()
.collect(Collectors.groupingBy(Request::getId))

Walked out like a boss*
😎

Comments
Add Comment