core/src/main/java/net/typedrest/BeanUtils.java
public static <TAnnotation extends Annotation> Optional<TAnnotation> getAnnotation(Class<?> beanType, PropertyDescriptor property, Class<TAnnotation> annotationType) {
        Optional<TAnnotation> annotation = stream(property.getReadMethod().getAnnotationsByType(annotationType)).findAny();
        return annotation.isPresent()
                ? annotation
                : getAnnotationOnField(beanType, property.getName(), annotationType);
    }
public static <TAnnotation extends Annotation> Optional<TAnnotation> getAnnotation(Class<?> beanType, PropertyDescriptor property, Class<TAnnotation> annotationType) {
        Optional<TAnnotation> annotation = stream(property.getReadMethod().getAnnotationsByType(annotationType)).findAny();
        return annotation.isPresent()
                ? annotation
                : getAnnotationOnField(beanType, property.getName(), annotationType);
    }
public static < TAnnotation extends Annotation > Optional < TAnnotation > getAnnotation ( Class < ? > beanType , PropertyDescriptor property , Class < TAnnotation > annotationType ) { Optional < TAnnotation > annotation = stream ( property . getReadMethod ( ) . getAnnotationsByType ( annotationType ) ) . findAny ( ) ; return annotation . isPresent ( ) ? annotation : getAnnotationOnField ( beanType , property . getName ( ) , annotationType ) ; }
Returns an annotation of a specific type on a property's getter or its
backing field.

@param <TAnnotation> The type of annotation to look for.
@param beanType The type of bean the property is declared on.
@param property The property to check for the annotation.
@param annotationType The type of annotation to look for.
@return The annotation if present.
Returns an annotation of a specific type on a property s getter or its backing field .