@TestFactory
    Stream<DynamicTest> ensureAllFunctionsAnnotated() {
        final Instant start = Instant.now();

        final FunctionFactory functionFactory = new FunctionFactory();

        LOGGER.info("Completed in {}", Duration.between(start, Instant.now()));

        // Scan the class path to find all the classes with @FunctionDef
        try (ScanResult result = new ClassGraph()
                .acceptPackages(Function.class.getPackageName())
                .enableClassInfo()
                .ignoreClassVisibility()
                .enableAnnotationInfo()
                .scan()) {

            final List<Class<? extends Function>> allFunctionClasses = result.getAllClasses()
                    .stream()
                    .filter(classInfo -> classInfo.implementsInterface(Function.class.getName()))
                    .filter(classInfo -> !classInfo.hasAnnotation(ArchitecturalFunction.class.getName()))
                    .map(classInfo -> (Class<? extends Function>) classInfo.loadClass())
                    .collect(Collectors.toList());

            return allFunctionClasses.stream()
                    .map(functionClass ->
                            DynamicTest.dynamicTest(
                                    functionClass.getSimpleName(),
                                    () ->
                                            examineFunctionClass(functionClass)));
        }
    }
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