List
- 过滤数组中分数为1的数据
List<MutualEvaluation> one = (List)((List)disSatisfiedList)
.stream().filter((x) -> x.getScore() == 1;})
.collect(Collectors.toList());
Map
- 按照分数划分区组,合格/不合格
// 根据得分划分成map,得分大于4的为true,否则为false
Map<Boolean, List<MutualEvaluation>> partMap = (Map)((List)mutualEvaluationList).stream().collect(Collectors.partitioningBy((x) -> {
return x.getScore() >= 4;
}));