public ResolvedType getTypeWithAnnotation(ResolvedType targetType, Class<? extends Annotation> annotationType,
            Predicate<Annotation> considerOtherAnnotation) {
        return this.getTypeConsideringHierarchyMatching(targetType, type -> this.getAnnotationFromList(annotationType,
                Arrays.asList(type.getErasedType().getAnnotations()), considerOtherAnnotation) != null);
    }
Find the (super) type, including interfaces, that has the designated type annotation.
<br>
Additionally, also consider annotations on annotations, if the given predicate indicates another annotation as eligible for holding the target.

@param targetType type to check for the annotation, potentially iterating over its declared interfaces and super types
@param annotationType type of annotation to look for
@param considerOtherAnnotation check whether some other annotation should also be checked for holding an instance of the target annotation
@return (super) type with the targeted annotation (or {@code null} if the annotation wasn't found on any of its interfaces or super types)

@since 4.30.0
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/TypeContext.java