Java8通过 Stream 流分组过滤等
List<String> openIdList = list.stream().map(o -> o.getOpenId()).collect(Collectors.toList());
Map<String, SearchActivityCustomerResultDto> userMap =
userList
.stream()
.collect(Collectors.toMap(SearchActivityCustomerResultDto::getOpenid, a -> a));
Map<Integer, List<Class>> groupBy =
appleList.stream().collect(Collectors.groupingBy(Class::getId));
List<Apple> filterList =
appleList.stream().filter(a -> a.getName().equals("香蕉")).collect(Collectors.toList());
appleList.subList((page - 1) * rows, rows * page);
List<Apple> pagingData = appleList.stream().limit(rows).collect(Collectors.toList());
List<Apple> result = appleList.stream().distinct().collect(toList());
BigDecimal totalAmount = subject.getChildren().stream().map(DelivPrjBudgetSubject :: getTotalAmount).reduce(BigDecimal.ZERO,BigDecimal::add).setScale(2,BigDecimal.ROUND_DOWN);