public static List<Purchase> removeDongxiangPurch(List<Purchase> listDongxiangPurchases){
ArrayList<Purchase> listDongxiangPurchase = listDongxiangPurchases.stream().collect(
Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(purchase -> purchase.getShopId() + purchase.getProductId()+ purchase.getFetchTime()))),
ArrayList::new
)
);
return listDongxiangPurchase;
}
去重。jdk1.8
最新推荐文章于 2023-11-12 19:47:31 发布

1805

被折叠的 条评论
为什么被折叠?



