Stream
生成Map
Map>
List<User> userArrayList = new ArrayList<>();
userArrayList.add(new User(1,"张三"));
userArrayList.add(new User(1,"李四"));
userArrayList.add(new User(2,"王五"));
Map<Integer, List<User>> collect = userArrayList.stream().collect(Collectors.groupingBy(User::getAge));