java8对list进行多字段去重(亲测可用)
List<CatTest> catList = Lists.newArrayList();
catList.stream()
.collect(
Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(cat -> cat.getCarHobby() + cat.getCatName()))),
ArrayList::new
)
);
划船不用桨、杨帆不等风、一生全靠浪