private static <A extends Annotation> A getOverriddenAnnotationFrom(
            Class<A> annotationClass, Class<?> searchClass, String name, Class<?>[] params, OptionalInt paramNumber) {
        try {
            final Method method = searchClass.getMethod(name, params);

            if (paramNumber.isPresent()) {
                int param = paramNumber.getAsInt();
                if (param > method.getParameterCount()) {
                    throw new IllegalArgumentException("Parameter number " + param + " out of range for "
                            + searchClass.getName() + " method " + name);
                }
                final A annotation = method.getParameters()[param].getAnnotation(annotationClass);
                if (annotation != null) {
                    return annotation;
                }
            } else {
                final A annotation = method.getAnnotation(annotationClass);
                if (annotation != null) {
                    return annotation;
                }
            }
            return getOverriddenAnnotation(annotationClass, Optional.of(method), paramNumber);
        } catch (final NoSuchMethodException e) {
            return null;
        }
    }
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