list分组
程序员文章站
2022-03-23 22:12:11
...
https://blog.csdn.net/ji519974770/article/details/83549240
public Map<String, List<Student>> groupList(List<Student> students) {
Map<String, List<Student>> map = students.stream().collect(Collectors.groupingBy(Student::getName));
return map;
}
public Map<String, List<Student>> groupList(List<Student> students) {
Map<String, List<Student>> map = students.stream().collect(Collectors.groupingBy(Student::getName));
return map;
}