boolean (@NotNull Class<? extends Annotation> annotationClass) { Class<?> aClass = getClass(); String methodName = "test" + getTestName(false); boolean methodChecked = false; while (aClass != null && aClass != Object.class) { if (aClass.getAnnotation(annotationClass) != null) return true; if (!methodChecked) { Method method = ReflectionUtil.getDeclaredMethod(aClass, methodName); if (method != null) { if (method.getAnnotation(annotationClass) != null) return true; methodChecked = true; } } aClass = aClass.getSuperclass(); } return false; }