code: static <T extends Annotation> T findAnnotation(Method method, Class<T> clazz) {
  		T annotation = AnnotationUtils.findAnnotation(method, clazz);
  		if (annotation == null) {
  			try {
  				annotation = AnnotationUtils.findAnnotation(method.getDeclaringClass()
  						.getMethod(method.getName(), method.getParameterTypes()), clazz);
  			}
  			catch (NoSuchMethodException | SecurityException ex) {
  				if (log.isDebugEnabled()) {
  					log.debug("Exception occurred while tyring to find the annotation",
  							ex);
  				}
  			}
  		}
  		return annotation;
  	}
docs: Searches for an annotation either on a method or inside the method parameters.
  @param <T> - annotation
  @param clazz - class with annotation
  @param method - annotated method
  @return annotation