### Question:
CollectorsDemo { public void reduce(List<Student> students){ int totalAge = students.stream() .filter(student -> "计算机科学".equals(student.getMajor())) .map(Student::getAge) .reduce(0, (a, b) -> a + b); System.out.println("reduce: totalAge=" + totalAge); int totalAge2 = students.stream() .filter(student -> "计算机科学".equals(student.getMajor())) .map(Student::getAge) .reduce(0, Integer::sum); System.out.println("reduce: totalAge2=" + totalAge2); Optional<Integer> totalAge3 = students.stream() .filter(student -> "计算机科学".equals(student.getMajor())) .map(Student::getAge) .reduce(Integer::sum); System.out.println("reduce: totalAge3=" + totalAge3); }  void filter(List<Student> students, List<Integer> nums); void map(List<Student> students); void match(List<Student> students); void reduce(List<Student> students); void collect_reduce(List<Student> students); void collect_group(List<Student> students); void collect_partitioning(List<Student> students);  }### Answer:
@Test public void reduce(){ collectorsDemo.reduce(studentList); }