private void doSignatureAssertions(final SoftAssertions softAssertions,
                                       final FunctionDef functionDef,
                                       final String className,
                                       final FunctionSignature signature,
                                       final int sigIndex) {
        final String classAndSigName = getName(className, sigIndex);

        assertMaxOneItemInArray(
                softAssertions,
                classAndSigName,
                "FunctionSignature.category",
                signature.category());

        assertMaxOneItemInArray(
                softAssertions,
                classAndSigName,
                "FunctionSignature.returnType",
                signature.returnType());

        final boolean hasCategory = functionDef.commonCategory().length > 0
                || signature.category().length > 0;

        softAssertions.assertThat(hasCategory)
                .withFailMessage(
                        classAndSigName + " - Either FunctionDef.commonCategory or " +
                                "FunctionSignature.category must be set")
                .isTrue();

        final boolean hasDescription = !functionDef.commonDescription().isEmpty()
                || !signature.description().isEmpty();

        softAssertions.assertThat(hasDescription)
                .withFailMessage(
                        classAndSigName + " - Either FunctionDef.commonDescription or " +
                                "FunctionSignature.description must be set")
                .isTrue();

        final boolean hasReturnType = functionDef.commonReturnType().length > 0
                || signature.returnType().length > 0;

        softAssertions.assertThat(hasReturnType)
                .withFailMessage(
                        classAndSigName + " - Either FunctionDef.commonReturnType or " +
                                "FunctionSignature.returnType must be set")
                .isTrue();

        softAssertions.assertThat(Arrays.stream(signature.args())
                        .filter(FunctionArg::isVarargs)
                        .count())
                .withFailMessage(classAndSigName +
                        " - Only one argument can be a varargs argument.")
                .isLessThanOrEqualTo(1);

        assertOptionalArgs(softAssertions, classAndSigName, signature.args());

        if (Arrays.stream(signature.args())
                .anyMatch(arg -> arg.isOptional() && arg.isVarargs())) {
            softAssertions.fail(classAndSigName +
                    " - Found an argument that is both optional and varargs. They are mutually exclusive.");
        }
    }
This ia more of a QA to ensure all the annotations are set correctly for the functions
stroom-query/stroom-query-language/src/test/java/stroom/query/language/functions/TestFunctionFactory.java