public static <T, R> List<R> transformAsList(Collection<T> values, Function<T, R> mapper) {
        List<R> list = new ArrayList<>(values.size());
        for (T value : values) {
            list.add(mapper.apply(value));
        }
        return list;
    }
Note that the method only checks the immutable classes used by Turms.
turms-server-common/src/main/java/im/turms/server/common/infra/collection/CollectionUtil.java