boolean (PsiMethod method) { final PsiModifierList modifierList = method.getModifierList(); return hasAnnotationWithParameter(modifierList, JUnitCommonClassNames.ORG_JUNIT_TEST, "expected") || hasAnnotationWithParameter(modifierList, "org.testng.annotations.Test", "expectedExceptions"); }