public <R> R createProxy(Mapper mapper) {
        this.mapper = mapper;
        Class<?> clazz = mapper.getClass();
        Set<Class<?>> interfacesSet = new HashSet<>();
        while (!clazz.equals(Object.class)) {
            interfacesSet.addAll(Arrays.stream(clazz.getInterfaces())
                    .filter(Mapper.class::isAssignableFrom)
                    .collect(Collectors.toSet()));
            clazz = clazz.getSuperclass();
        }
        return (R) Proxy.newProxyInstance(MapperProxy.class.getClassLoader(), interfacesSet.toArray(new Class<?>[interfacesSet.size()]), this);
    }
@Test
    void testCreateProxy() {
        Mapper mapper = new Mapper() {
            @Override
            public String select(List<String> columns, List<String> where) {
                return "select-test";
            }
            
            @Override
            public String insert(List<String> columns) {
                return "insert-test";
            }
            
            @Override
            public String update(List<String> columns, List<String> where) {
                return "update-test";
            }
            
            @Override
            public String delete(List<String> params) {
                return "delete-test";
            }
            
            @Override
            public String count(List<String> where) {
                return "count-test";
            }
            
            @Override
            public String getTableName() {
                return "test";
            }

            @Override
            public String getDataSource() {
                return "test";
            }

            @Override
            public String[] getPrimaryKeyGeneratedKeys() {
                return new String[0];
            }

            @Override
            public String getFunction(String functionName) {
                return TrustedMysqlFunctionEnum.getFunctionByName(functionName);
            }
        };
        Mapper proxy = mapperProxy.createProxy(mapper);
        try {
            Field field = proxy.getClass().getSuperclass().getDeclaredField("h");
            field.setAccessible(true);
            MapperProxy mapperProxy = (MapperProxy) field.get(proxy);
            Field mapperField = mapperProxy.getClass().getDeclaredField("mapper");
            mapperField.setAccessible(true);
            Class<?> clazz = mapperField.getDeclaringClass();
            assertEquals(MapperProxy.class, clazz);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            e.printStackTrace();
        }
    }