Bootstrap

Java stream流使用 分组

1. stream分组后,key为分组条件,value为分组之后的聚合list的数量

list.stream().collect(Collectors.groupingBy(CommentReport::getCommentId, Collectors.counting()));
;