boolean (PsiElement element) { element = PsiTreeUtil.getParentOfType(element, PsiModifierListOwner.class, false); if (element instanceof PsiMethod) { final PsiClass aClass = ((PsiMethod) element).getContainingClass(); final TestData data = myConfig.getPersistantData(); return aClass != null && Comparing.strEqual(data.MAIN_CLASS_NAME, JavaExecutionUtil.getRuntimeQualifiedName(aClass)) && Comparing.strEqual(data.METHOD_NAME, ((PsiMethod) element).getName()); } return false; }