取最大值
取优先级最高的资源组
// 如果分组下有多个资源组,则选择优先级最高的资源组添加到合并后的集合中
ResGroupMiddleStat resGroupMiddleStat = resGroupMiddleStats.stream()
.max(Comparator.comparing(ResGroupMiddleStat::getPriority))
.orElse(null);
取优先级最高的资源组
// 如果分组下有多个资源组,则选择优先级最高的资源组添加到合并后的集合中
ResGroupMiddleStat resGroupMiddleStat = resGroupMiddleStats.stream()
.max(Comparator.comparing(ResGroupMiddleStat::getPriority))
.orElse(null);