code: public static boolean hasMethodWithAnnotation(Class<?> type,
                                                    Class<? extends Annotation> annotationType,
                                                    boolean checkMetaAnnotations) {
          try {
              do {
                  Method[] methods = type.getDeclaredMethods();
                  for (Method method : methods) {
                      if (hasAnnotation(method, annotationType, checkMetaAnnotations)) {
                          return true;
                      }
                  }
                  type = type.getSuperclass();
              } while (type != null);
          } catch (Throwable e) {
              // ignore a class loading issue
          }
          return false;
      }
docs: Returns true if the given type has a method with the given annotation