1、Strem函数List<People>list=newArrayList<>();//根据age对list分组,得到mapMap<String,List<People>>groupByAge=list.stream().collect(Collectors.groupingBy(People::getAge));//根据age进行排序(reserve倒序)得到排序后的ListList<People>peopleListSorted=list.stream().sorted(Comparator.