private <A extends Annotation> boolean shouldConsiderAnnotation(A annotation, Function<A, Class<?>[]> validationGroupsLookup) {
        // avoid repeated null checks by doing it here
        if (annotation == null) {
            return false;
        }
        // no specific validation groups means: all annotations are fair game
        if (this.validationGroups == null) {
            return true;
        }
        // check that the annotation's validation groups have at least one common entry to the configured groups on this module
        Class<?>[] associatedGroups = validationGroupsLookup.apply(annotation);
        return associatedGroups.length == 0 || Arrays.stream(associatedGroups)
                .anyMatch(associatedGroup -> this.validationGroups.stream().anyMatch(associatedGroup::isAssignableFrom));
    }
Check whether a given annotation is supposed to be considered in the schema generation. I.e. if specific validation groups are defined, it must
belong to at least one of them.

@param <A> type of annotation
@param annotation annotation instance (may be {@code null}, which will result in {@code false} to be returned)
@param validationGroupsLookup how to look-up the associated validation groups of an annotation instance
@return whether the given annotation should be considered in the current schema generation
jsonschema-module-jakarta-validation/src/main/java/com/github/victools/jsonschema/module/jakarta/validation/JakartaValidationModule.java