lambda-collect-Collectors(Collectors.toCollection,groupingBy,partitioningBy,summingInt,joining)-CSDN博客

网站介绍:文章浏览阅读7.7k次。collect–将流转换为其他形式。接受一个Collector接口的实现,用于给stream中元素做汇总的方法构造测试数据List<Map<String, String>> list = new ArrayList<>();Map<String, String> map = new HashMap<>();map.put("name", "joy");map.put("age", "23");list.add(map);map = n_collectors.tocollection