public static <T, R> Set<R> toSet(Collection<T> collection, Function<T, R> function) {
        return stream(collection)
            .filter(Objects::nonNull)
            .map(function)
            .filter(Objects::nonNull)
            .collect(Collectors.toSet());
    }
Convert a collection into a set
<p>
Will filter out empty data before and after conversion in the collection

@param collection collection
@param function conversion function
@param <T> Data type before conversion
@param <R> Data type after conversion
@return list If the input parameter is empty, an empty array will be returned and cannot be modified.
chat2db-server/chat2db-server-tools/chat2db-server-tools-common/src/main/java/ai/chat2db/server/tools/common/util/EasyCollectionUtils.java