public static <T> List<T> castList(final List<?> list, final Class<T> clazz) {
        if (CollectionUtils.isEmpty(list)) {
            return Collections.emptyList();
        }
        return list.stream().map(clazz::cast).collect(Collectors.toList());
    }
cast list.

@param list collections
@param clazz class type
@param <T> the type parameter
@return the result
shenyu-common/src/main/java/org/apache/shenyu/common/utils/ListUtil.java