code: public static <T extends Annotation> T findAnnotation(Method m, Class<?> clazz, Class<T> annotationClazz) {
          final T result = findAnnotation(m, annotationClazz);
          return result != null ? result : findAnnotation(clazz, annotationClazz);
      }
docs: Returns the annotation object for the specified annotation class of
  either the method if it can be found, or of the given class object. First
  the annotation is searched via the method
  {@link #findAnnotation(java.lang.reflect.Method, java.lang.Class) }. If
  the annotation can not be found, the method
  {@link #findAnnotation(java.lang.Class, java.lang.Class) } is used to find
  the annotation on class level.
  
  @param <T>             The annotation type
  @param m               The method in which to look for the annotation
  @param clazz           The class in which to look for the annotation if it can not be
  found on method level
  @param annotationClazz The type of the annotation to look for
  @return The annotation with the given type if found, otherwise null