List<Person> personList2 = new ArrayList<Person>();
personList2.add(new Person("Tom", 8900, 23, "male", "New York"));
List<Person> personList = new ArrayList<Person>();
personList.add(new Person("Tom", 8900, 23, "male", "New York"));
personList.add(new Person("Jack", 7000, 25, "male", "Washington"));
personList.add(new Person("Lily", 7800, 21, "female", "Washington"));
personList.add(new Person("Anni", 8200, 24, "female", "New York"));
personList.add(new Person("Owen", 8200, 25, "male", "New York"));
personList.add(new Person("Alisa", 7900, 26, "female", "New York"));
personList.add(new Person("Alisa", 1, 1, "1", "New 1York"));
List<String> strs = personList.stream().map(Person::getName).collect(Collectors.toList());
Map<String,Person > retMap = personList2.stream().collect(Collectors.toMap(Person::getName, data -> data, (d1,d2)->d1));
List<Person> ret = personList.stream().filter(data -> null != retMap.get(data.getName())).collect(Collectors.toList());
List<Person> ret1 = personList.stream().filter(data -> data.getMoney() > 8000).filter(data -> data.getAge() < 25).collect(Collectors.toList());
System.out.println(ret1);
Map<String,Integer > ret2 = personList.stream().collect(Collectors.toMap(Person::getName, data -> data.getMoney(), (d1,d2)->d1));
Map<String,Person > ret3Map = personList2.stream().collect(Collectors.toMap(d -> d.getName()+"_"+d.getMoney(), data -> data, (d1,d2)->d1));
List<Person> ret3 = personList.stream().filter(d -> null != ret3Map.get(d.getName()+"_"+d.getMoney())).collect(Collectors.toList());
List<Person> ret4= personList.stream().map(data -> {
data.setNameTwo(data.getName());
return data;
}).collect(Collectors.toList());
Optional<Person> max = personList.stream().max(Comparator.comparingInt(Person::getMoney));
System.out.println(max);
Optional<Person> min = personList.stream().min(Comparator.comparingInt(Person::getMoney));
System.out.println(min);
long count = personList.stream().count();
List<Person> ret5 = personList.stream().sorted(Comparator.comparing(data -> data.getMoney())).collect(Collectors.toList());
List<Person> ret6 = personList.stream().sorted(Comparator.comparing(Person::getMoney).reversed()).collect(Collectors.toList());
List<Person> ret7 = personList.stream().sorted(Comparator.comparing(Person::getMoney).thenComparing(Person::getAge)).collect(Collectors.toList());
System.out.println(123123);