@Override
    public void validate(final String methodName, final Class<?>[] parameterTypes, final Object[] arguments) throws Exception {
        List<Class<?>> groups = new ArrayList<>();
        Class<?> methodClass = methodClass(methodName);
        if (Objects.nonNull(methodClass)) {
            groups.add(methodClass);
        }
        Set<ConstraintViolation<?>> violations = new HashSet<>();
        Method method = clazz.getMethod(methodName, parameterTypes);
        Class<?>[] methodClasses;
        if (method.isAnnotationPresent(MethodValidated.class)) {
            methodClasses = method.getAnnotation(MethodValidated.class).value();
            groups.addAll(Arrays.asList(methodClasses));
        }
        // add into default group
        groups.add(0, Default.class);
        groups.add(1, clazz);

        // convert list to array
        Class<?>[] classGroups = new Class<?>[groups.size()];
        classGroups = groups.toArray(classGroups);

        Object parameterBean = getMethodParameterBean(clazz, method, arguments);
        if (parameterBean != null) {
            violations.addAll(validator.validate(parameterBean, classGroups));
        }

        for (Object arg : arguments) {
            validate(violations, arg, classGroups);
        }

        if (!violations.isEmpty()) {
            LOG.error("Failed to validate service: {}, method: {}, cause: {}", clazz.getName(), methodName, violations);
            StringBuilder validateError = new StringBuilder();
            violations.forEach(each -> validateError.append(each.getMessage()).append(","));
            throw new ValidationException(validateError.substring(0, validateError.length() - 1));
        }
    }
@Test
    public void validate() throws Exception {
        URL url = URL.valueOf("dubbo://127.0.0.1:20880/org.apache.shenyu"
                + ".client.apache.dubbo.validation.service.TestService"
                + "?accepts=500&anyhost=true&application=shenyu-proxy"
                + "&bind.ip=127.0.0.1&bind.port=20880&deprecated=false"
                + "&dubbo=2.0.2&dynamic=true&generic=false"
                + "&interface=org.apache.shenyu.client.apache.dubbo.validation.service.TestService"
                + "&keep.alive=true&methods=test&pid=67352&qos.enable=false&release=2.7.0"
                + "&side=provider&threadpool=fixed&threads=500&timeout=20000"
                + "&timestamp=1608119259859&validation=shenyuValidation");
        Validator apacheDubboClientValidator = new ApacheDubboClientValidation().getValidator(url);

        apacheDubboClientValidator.validate("test",
                new Class[]{TestService.TestObject.class},
                new Object[]{new TestService.TestObject(1)});
    }