public void parameterOverloadValidation(ParameterOverload[] parameterOverloads, Parameter[] parameters)
            throws AnnotationValidationException {

        Map<String, Parameter> parameterMap = new HashMap<>();
        Set<String> mandatoryParameterSet = new HashSet<>();
        for (Parameter parameter : parameters) {
            parameterMap.put(parameter.name(), parameter);
            if (!parameter.optional()) {
                mandatoryParameterSet.add(parameter.name());
            }
        }

        for (ParameterOverload parameterOverload : parameterOverloads) {
            String[] overloadParameterNames = parameterOverload.parameterNames();
            for (String overloadParameterName : overloadParameterNames) {
                //Check if the @Parameter name is empty.
                if (overloadParameterName.isEmpty()) {
                    throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " +
                                    "@ParameterOverload -> parameterNames annotated in class {0} is null or empty.",
                            extensionClassFullName));
                } else if (!(PARAMETER_NAME_PATTERN.matcher(overloadParameterName).find() ||
                        REPETITIVE_PARAMETER_NOTATION.equals(overloadParameterName))) {
                    //Check if the @Parameter name is in a correct format 'abc.def.ghi' using regex pattern.
                    throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " +
                            "@ParameterOverload -> parameterNames {0} annotated in class {1} is not " +
                            "in proper format 'abc.def.ghi'.", overloadParameterName, extensionClassFullName));
                }
                if (!(parameterMap.containsKey(overloadParameterName) ||
                        REPETITIVE_PARAMETER_NOTATION.equals(overloadParameterName))) {
                    throw new AnnotationValidationException(MessageFormat.format("The @Extension -> " +
                            "@ParameterOverload -> parameterNames {0} annotated in class {1} is not defined in " +
                            "@Extension -> @Parameter.", overloadParameterName, extensionClassFullName));
                }
            }
        }

        if (parameterOverloads.length > 0) {
            Set<String> mandatoryParameterSetViaOverload = new HashSet<>(parameterMap.keySet());
            for (Iterator<String> iterator = mandatoryParameterSetViaOverload.iterator(); iterator.hasNext(); ) {
                String parameter = iterator.next();
                for (ParameterOverload parameterOverload : parameterOverloads) {
                    boolean contains = false;
                    for (String parameterName : parameterOverload.parameterNames()) {
                        if (parameter.equalsIgnoreCase(parameterName)) {
                            contains = true;
                            break;
                        }
                    }
                    if (!contains) {
                        iterator.remove();
                        break;
                    }
                }
            }

            if (!mandatoryParameterSetViaOverload.equals(mandatoryParameterSet)) {
                throw new AnnotationValidationException("Mandatory parameter information in ParameterOverload " +
                        "and based on 'optional' annotation is a mismatch. The parameters '" +
                        mandatoryParameterSetViaOverload + "' always appearing in ParameterOverload, but '" +
                        mandatoryParameterSet + "' are defined as not 'optional' in the annotations.");
            }
        }
    }
This method uses for validate @Extension / @ParameterOverload element.

@param parameterOverloads parameter array which needs to be validate.
@param parameters         the set of supported parameters
@throws AnnotationValidationException whenever if the validate rule violate, throws the annotation validate
                                      exception with proper message.
modules/siddhi-annotations/src/main/java/io/siddhi/annotation/processor/AbstractAnnotationProcessor.java