List<Map<String, Object>> dataList = new ArrayList<>();
Integer total = dataList.stream().mapToInt(e -> Integer.parseInt(e.get("num").toString())).sum(); //求num的总数量
dataList = dataList.stream().sorted((e1,e2) -> {
return -Double.compare(Double.valueOf(e1.get("num").toString()),Double.valueOf(e2.get("num").toString()));
}).collect(Collectors.toList()); //排序
dataList = dataList.stream().filter(e ->Integer.parseInt(e.get("caseNum").toString()) != 0).collect(Collectors.toList()); //过滤
Set<Map.Entry<String, List<Map<String, Object>>>> entries = dataList.stream()
.collect(Collectors.groupingBy(x -> x.get("code") + "_" + x.get("value") + "_" + x.get("name"))).entrySet(); //分组
-----------------------------------
java8 List<Map<String, Object>>求和,排序,过滤,分组
https://blog.51cto.com/u_15067247/4271336