public static <R, T> List<T> castList(final List<R> list, final Function<R, T> mapper) {
        if (CollectionUtils.isEmpty(list)) {
            return Collections.emptyList();
        }
        return list.stream().map(mapper).collect(Collectors.toList());
    }
cast list.
@param list list
@param mapper mapper
@param <R> the source type parameter
@param <T> the target type parameter
@return the result
shenyu-common/src/main/java/org/apache/shenyu/common/utils/ListUtil.java