public static String getTestName(final TestClass testClass, final FrameworkMethod method) {
String testName = method.getName();
Display methodDisplay = method.getMethod().getAnnotation(Display.class);
Display classDisplay = testClass.getJavaClass().getAnnotation(Display.class);
Display policyDisplay = null;
TestPolicy testPolicy = testClass.getJavaClass().getAnnotation(TestPolicy.class);
if (testPolicy != null) {
Class<?> policyClass = testPolicy.value();
policyDisplay = policyClass.getAnnotation(Display.class);
}
Display displayAnnotation = methodDisplay != null ? methodDisplay : classDisplay != null ? classDisplay
: policyDisplay;