根据list下标3的值去重复 List<ArrayList<String>> collect1 = lists.stream().filter(distinctByKey(li -> li.get(3))).collect(Collectors.toList());
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { Map<Object, Boolean> seen = new ConcurrentHashMap<>(); return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; }