1.list集合分组转为map
// 按照学生学号分组,map的键就是学生的学号,值对应的是学生的整体信息
Map<String, List<Student>> map = studentList.stream()
.collect(Collectors.groupingBy(Student::getNo));
2.list集合对象中,只需要获取该对象的某一属性信息
//如获取所有学生的学生姓名
List<String> studentListNames = studentList.stream().map(Student::getName)
.collect(Collectors.toList());
3. list转为map.value的值可能为空
HashMap<String, Student> map = studentList.stream()
.collect(HashMap::new, (key, value) -> key.put(String.