stream java8 去重复元素

           reports = reports.stream().collect(Collectors.collectingAndThen(
                                Collectors.toCollection(() ->
                                        new TreeSet<>(Comparator.comparing(YyAmazonInventoryReport::getSku))),
                                ArrayList::new)
                        );
原文地址:https://www.cnblogs.com/zrboke/p/14918527.html