code: @SuppressWarnings("unchecked")
      public static <T> List<T> getAnnotations(final Class c, final Class<T> annotation) {
          final List<T> found = new ArrayList<T>();
          // TODO isn't that actually breaking the contract of @Inherited?
          if (c.isAnnotationPresent(annotation)) {
              found.add((T) c.getAnnotation(annotation));
          }
  
          Class parent = c.getSuperclass();
          while ((parent != null) && (parent != Object.class)) {
              if (parent.isAnnotationPresent(annotation)) {
                  found.add((T) parent.getAnnotation(annotation));
              }
  
              // ...and interfaces that the superclass implements
              for (final Class interfaceClass : parent.getInterfaces()) {
                  if (interfaceClass.isAnnotationPresent(annotation)) {
                      found.add((T) interfaceClass.getAnnotation(annotation));
                  }
              }
  
              parent = parent.getSuperclass();
          }
  
          // ...and all implemented interfaces
          for (final Class interfaceClass : c.getInterfaces()) {
              if (interfaceClass.isAnnotationPresent(annotation)) {
                  found.add((T) interfaceClass.getAnnotation(annotation));
              }
          }
          // no annotation found, use the defaults
          return found;
      }
docs: Returns the (first) instance of the annotation, on the class (or any superclass, or interfaces implemented).
  
  @param c          the class to examine
  @param annotation the annotation to find
  @param <T>        the type of the annotation
  @return the list of annotations