public static <A extends Annotation> A getInheritedClassOrMethodAnnotation(
            Class<A> annotationClass, AnnotatedElement annotatedElement) {
        if (annotatedElement instanceof Class<?>) {
            return getInheritedClassAnnotation(annotationClass, (Class<?>) annotatedElement);
        }
        if (annotatedElement instanceof Method) {
            return getInheritedMethodAnnotation(annotationClass, (Method) annotatedElement);
        }
        if (annotatedElement == null) {
            return null;
        }
        throw new IllegalArgumentException("This method requires an instance of Method or Class, got "
                + annotatedElement.getClass().getName());
    }
Class that finds annotations on superclasses/interfaces of supplied instance.
<p>
Credit for initial implementation goes to the author of this answer on Stack Overflow: https://stackoverflow.com/a/17281097
stroom-event-logging-rs/stroom-event-logging-rs-impl/src/main/java/stroom/event/logging/rs/impl/AnnotationUtil.java