code: public static <T extends Annotation> T findAnnotation(Method m, Class<T> annotationClazz) {
          T annotation = m.getAnnotation(annotationClazz);
          if (annotation != null) {
              return annotation;
          }
  
          if (stereotypeAnnotationClass != null) {
              List<Class<?>> annotations = new ArrayList<>();
              for (Annotation a : m.getAnnotations()) {
                  annotations.add(a.annotationType());
              }
              return findAnnotation(annotations, annotationClazz);
          }
  
          return null;
      }
docs: Returns the annotation object for the specified annotation class of the
  method if it can be found, otherwise null. The annotation is searched in
  the method which and if a stereotype annotation is found, the annotations
  present on an annotation are also examined. If the annotation can not be
  found, null is returned.
  
  @param <T>             The annotation type
  @param m               The method in which to look for the annotation
  @param annotationClazz The type of the annotation to look for
  @return The annotation with the given type if found, otherwise null