// 去重 static <T, R> Predicate<T> distinctByKey(Function<? super T, R> keyExtractor) { Map<R, Boolean> seen = new ConcurrentHashMap<>(); return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; }
京公网安备 11010502049817号