List<WeChatCustomerDTO> collect = list.stream().filter(distinctByKey(WeChatCustomerDTO::getExternal_userid)).collect(Collectors.toList());
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Set<Object> seen = ConcurrentHashMap.newKeySet();
return t -> seen.add(keyExtractor.apply(t));
}