code: private static <A extends Annotation> A getAnnotation( AnnotatedElement from, Class<A> annotationType, Set<AnnotatedElement> visited) {
          if( visited.contains(from) ) return null;
          visited.add(from);
          A ann = from.getAnnotation( annotationType );
          if( ann != null) return ann;
          for ( Annotation metaAnn : from.getAnnotations() ) {
              ann = getAnnotation(metaAnn.annotationType(), annotationType, visited);
              if ( ann != null ) {
                  return ann;
              }
          }
          return null;
      }
docs: Searches for an Annotation of the given type on the class.  Supports meta annotations.
  
  @param from AnnotatedElement (class, method...)
  @param annotationType Annotation class to look for.
  @param <A> Class of annotation type
  @return Annotation instance or null