code: public static boolean hasAnnotationDeep(Class<?> memberDeclaringClass, Class<? extends Annotation> candidate)
      {
  
          if (memberDeclaringClass.equals(candidate))
          {
              return true;
          }
  
          for (Annotation anno : memberDeclaringClass.getAnnotations())
          {
              Class<? extends Annotation> annoClass = anno.annotationType();
              if (!annoClass.getPackage().getName().startsWith("java.lang") && hasAnnotationDeep(annoClass, candidate))
              {
                  return true;
              }
          }
  
          return false;
      }
docs: Indicates if a class or at least one of its annotations is annotated by a given annotation.
  <p>
  Notice that the classes with a package name starting with "java.lang" will be ignored.
  </p>
  @param memberDeclaringClass the class to check
  @param candidate the annotation to find
  @return true if the annotation is found, false otherwise