1、查询Student对象,得到集合List<Student>
2、声明集合List<List<Student>>,将分割后的集合存储到该集合中
3、使用Strea流指定Student对象,通过Collectors.groupingBy,声明对根据name分割
4、将结果遍历添加到studentGroupList中
List<Student> studentList = studentMapper.selectStudent();
List<List<Student>> studentGroupList = new ArrayList<>();
studentList.stream().collect(Collectors.groupingBy(Student::getName, Collectors.toList()))
.forEach((model, list) -> {
studentGroupList.add(list);
});