code: private <A extends Annotation> A getInterfacesAnnotation(Class<?> annotatedType, Class<A> annotation) {
  
      Class<?>[] interfaces = annotatedType.getInterfaces();
      for (int i = 0; i < interfaces.length; i++) {
        A result = interfaces[i].getAnnotation(annotation);
        if (result != null) {
          return result;
        }
      }
      for (int i = 0; i < interfaces.length; i++) {
        A result = getInterfacesAnnotation(interfaces[i], annotation);
        if (result != null) {
          return result;
        }
      }
      return null;
    }
docs: This method gets the first {@link Class#getAnnotation(Class) annotation} of the type given by {@code annotation} in
  the {@link Class#getInterfaces() hierarchy} of the given {@code annotatedInterface} . <br>
  This method is only useful if the given {@code annotation} is a {@link #isRuntimeAnnotation(Class) runtime
  annotation} that is {@link #isAnnotationForType(Class, ElementType) applicable} for {@link ElementType#TYPE
  classes}.
  
  @param <A> is the type of the requested annotation.
  @param annotatedType is the type potentially implementing an interface annotated with the given {@code annotation}.
  This should NOT be an {@link Class#isPrimitive() primitive}, {@link Class#isArray() array},
  {@link Class#isEnum() enum}, or {@link Class#isAnnotation() annotation}.
  @param annotation is the type of the requested annotation.
  @return the requested annotation or {@code null} if neither the {@code annotatedInterface} nor one of its
  {@link Class#getInterfaces() super-interfaces} are {@link Class#getAnnotation(Class) annotated} with the
  given {@code annotation}.