public static <E> List<E> union(List<? extends E> list1, List<? extends E> list2) {
        ArrayList<E> result = new ArrayList();
        if(list1 != null && list1.size()>0) {
            result.addAll(list1);
        }
        if(list2!= null && list2.size()>0) {
            result.addAll(list2);
        }
        return result;
    }
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