class ClassUtil {

    /**
     * 支持配置和SPI，优先级：配置类 > SPI > 默认值
     *
     * @param classStr        配置串，可空
     * @param spi             SPI 接口
     * @param properties      配置属性
     * @param defaultSupplier 默认值
     */
    @SuppressWarnings("unchecked")
    public static <T> T newInstance(String classStr, Class<T> spi, Properties properties, Supplier<T> defaultSupplier) {
        if (StringUtil.isNotEmpty(classStr)) {
            try {
                Class<?> cls = Class.forName(classStr);
                return (T) newInstance(cls, properties);
            } catch (Exception ignored) {
            }
        }
        T result = null;
        if (spi != null) {
            ServiceLoader<T> loader = ServiceLoader.load(spi);
            for (T t : loader) {
                result = t;
                break;
            }
        }
        if (result == null) {
            result = defaultSupplier.get();
        }
        if (result instanceof PageProperties) {
            ((PageProperties) result).setProperties(properties);
        }
        return result;
    }

    @SuppressWarnings("unchecked")
    public static <T> T newInstance(String classStr, Properties properties) {
        try {
            Class<?> cls = Class.forName(classStr);
            return (T) newInstance(cls, properties);
        } catch (Exception e) {
            throw new PageException(e);
        }
    }

    public static <T> T newInstance(Class<T> cls, Properties properties) {<FILL_FUNCTION_BODY>}

    public static Class<?> getServletRequestClass() throws ClassNotFoundException {
        Class<?> requestClass = null;
        try {
            requestClass = Class.forName("javax.servlet.ServletRequest");
        }catch (ClassNotFoundException exception){
        }
        if (requestClass != null){
            return requestClass;
        }
        return Class.forName("jakarta.servlet.ServletRequest");
    }
}

        try {
            T instance = cls.newInstance();
            if (instance instanceof PageProperties) {
                ((PageProperties) instance).setProperties(properties);
            }
            return instance;
        } catch (Exception e) {
            throw new PageException(e);
        }
    
<no_super_class>