public static <E,R> List<E> distinctByKey(Collection<E> collection, Function<E, R> keyFunction){
        return stream(collection).filter(distinctByKey(keyFunction)).collect(Collectors.toList());
    }
Deduplication based on specified field collection
@param collection original collection
@param keyFunction keyFunction
@param <E>
@param <R>
@return the collection after deduplication
chat2db-server/chat2db-server-tools/chat2db-server-tools-common/src/main/java/ai/chat2db/server/tools/common/util/EasyCollectionUtils.java