stram的简单使用
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class Test {
public static void main(String[] args) {
List<StudentScoreInfo> list = new ArrayList();
list.add(new StudentScoreInfo(1, "张三", "语文", 90));
list.add(new StudentScoreInfo(2, "张三", "数学", 98));
list.add(new StudentScoreInfo(3, "李四", "语文", 95));
list.add(new StudentScoreInfo(4, "李四", "数学", 88));
list.add(new StudentScoreInfo(5, "王武", "语文", 90));
list.add(new StudentScoreInfo(6, "王武", "数学", 98));
list.add(new StudentScoreInfo(7, "赵四", "语文", 66));
list.add(new StudentScoreInfo(8, "赵四", "数学", 77));
// 分组:根据科目分组
Map<String, List<StudentScoreInfo>> res1 = list.stream().