public static <A extends Annotation> A getAnnotation(final Class<A> annotation, final Method method) {
        try {
            return DaemonScanner.isAnnotationPresent(annotation, method.getDeclaringClass(), method.getName(), method.getParameterTypes());
        } catch(final NoSuchMethodException e) {
            return null;
        }
    }
public static < A extends Annotation > A getAnnotation ( final Class < A > annotation , final Method method ) { try { return DaemonScanner . isAnnotationPresent ( annotation , method . getDeclaringClass ( ) , method . getName ( ) , method . getParameterTypes ( ) ) ; } catch ( final NoSuchMethodException e ) { return null ; } }
Checks also the inheritance hierarchy.

@param annotation Annotation
@param method     Method
@param <A>        Annotation
@return Annotation or null