public static void main(String arg[]) {
List<Employee> list = new ArrayList<Employee>();
list.add(new Employee("宋江","男",1500));
list.add(new Employee("武松","男",1200));
list.add(new Employee("林冲","男",1000));
list.add(new Employee("扈三娘","女",800));
list.add(new Employee("顾大嫂","女",500));
List<Employee> l1 = list.stream().filter(e -> e.getGender().equals("男")).collect(Collectors.toList());
List<String> l2 = list.stream().map(Employee::getName).collect(Collectors.toList());
Map<String, Integer> map = list.stream().collect(Collectors.groupingBy(Employee::getGender, Collectors.summingInt(p -> 1)));
Double sum = list.stream().filter(e -> e.getGender().equals("男")).mapToDouble(Employee::getSalary).sum();
Employee em = list.stream().reduce((e1, e2) -> e1.getSalary() > e2.getSalary() ? e1:e2).get();
Employee e2 = list.stream().collect(Collectors.maxBy(Comparator.comparing(Employee::getSalary))).get();
boolean check1 = list.stream().anyMatch(e -> e.getSalary() < 600);
boolean check2 = list.stream().allMatch(e -> e.getSalary() < 600);
boolean check3 = list.stream().noneMatch(e -> e.getSalary() < 400);
double avg = list.stream().collect(Collectors.averagingDouble(Employee::getSalary));
List<Employee> l3 = list.stream().sorted((s1, s2) -> s1.getSalary().compareTo(s2.getSalary())).collect(Collectors.toList());
List<Employee> l4 = l3.stream().limit(2).collect(Collectors.toList());
String str = list.stream().map(Employee::getName).collect(Collectors.joining(",", "[", "]"));
DoubleSummaryStatistics doubleSummaryStatistics = list.stream().mapToDouble(Employee::getSalary).summaryStatistics();
double average = doubleSummaryStatistics.getAverage();
double max = doubleSummaryStatistics.getMax();
double min = doubleSummaryStatistics.getMin();
long count = doubleSummaryStatistics.getCount();
double sum2 = doubleSummaryStatistics.getSum();
Map<String, Double> map1 = list.stream().collect(Collectors.toMap(Employee::getName, Employee::getSalary));
Map<String, Employee> map2 = list.stream().collect(Collectors.toMap(Employee::getName, employee->employee));
Map<String, Employee> map3 = list.stream().collect(Collectors.toMap(Employee::getName,Function.identity(),(k1,k2)->k2));
Map<String, List<Employee>> map4 = list.stream().collect(Collectors.groupingBy(Employee::getGender));
List<Employee> l5 = list.stream().skip(0).limit(10).collect(Collectors.toList());
}