注意List 使用前需要做非空处理
Map<String,List<User>> map= userList.stream().collect(Collectors.groupingBy(User::getName));
pictureList.stream().map(Picture::getSrc).collect(Collectors.toList());
roomList.stream().sorted(Comparator.comparing(Room::getAvgPrice)).collect(Collectors.toList());
roomList.stream().sorted(Comparator.comparing(Room::getAvgPrice).reversed()).collect(Collectors.toList());
rpTags.stream().distinct().collect(Collectors.toList());
benefitList.stream().filter(benefit -> benefit.getId() == 1 || benefit.getId() == 20 || benefit.getId() == 26 || benefit.getId() == 89) .findFirst().orElse(null);
getModule().stream().collect(Collectors.toMap(RateplanDO::getRateplanCode, rateplanDO -> rateplanDO));
partnerCityHotelDOList.stream().mapToInt(PartnerCityHotelDO::getId).max().orElse(-1);
partnerCityHotelDOList.stream().map(PartnerCityHotelDO::getId).collect(Collectors.toList());