@Override public <A extends Annotation> A getMethodAnnotation(Method annotatedMethod, Class<A> annotation) { if (!isRuntimeAnnotation(annotation)) { throw new AnnotationNotRuntimeException(annotation); } if (!isAnnotationForType(annotation, ElementType.METHOD)) { throw new AnnotationNotForTargetException(annotation, ElementType.METHOD); } A result = annotatedMethod.getAnnotation(annotation); if (result == null) { String methodName = annotatedMethod.getName(); Class<?>[] parameterTypes = annotatedMethod.getParameterTypes(); Class<?> inheritingClass = annotatedMethod.getDeclaringClass(); while (result == null) { Method currentMethod = getReflectionUtil().getParentMethod(inheritingClass, methodName, parameterTypes); if (currentMethod == null) { return null; } else { result = currentMethod.getAnnotation(annotation); inheritingClass = currentMethod.getDeclaringClass(); } } } return result; }