public static <T,R> List<T> mapList(Collection<T> collection, Function<? super T, ? extends R>... function) {
return collection.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(function))),ArrayList::new));;
}
对传入list根据多字段去重的通用方法,但是function怎么加入到比较器里面 因为我不确定传进去多少要比较的字段