@SuppressWarnings("unchecked")
    public static <A extends Annotation> A findAnnotation(Annotation annotation, Class<A> annotationType) {
        if (annotation == null) {
            throw new NullPointerException("annotation must not be null");
        }
        if (annotationType == null) {
            throw new NullPointerException("annotationType must not be null");
        }

        Class<? extends Annotation> annotationTypeClass = annotation.annotationType();
        if (annotationTypeClass == annotationType) {
            return (A) annotation;
        }

        boolean inherited = annotationType.isAnnotationPresent(Inherited.class);
        return findAnnotation(annotationTypeClass, annotationType, inherited, new HashSet<>());
    }
If the {@code annotation}'s annotationType is not {@code annotationType}, then to find the
first annotation of {@code annotationType} that is either
<em>directly present</em>, <em>meta-present</em>, or <em>indirectly
present</em> on the supplied {@code element}.

@param annotation annotation
@param annotationType the annotation type of need to search
@param <A> the searched annotation type
@return the searched annotation
core/src/main/java/com/alibaba/fastjson2/util/BeanUtils.java