Java8 编码 Java 8 list集合去重 orderList1.addAll(orderList2); List<EsOrder> orderList = orderList1.stream() .collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EsOrder::getOrderSn))), ArrayList::new));