PsiElement () { @NonNls String val = getValue(); final String methodName = StringUtil.getShortName(val); PsiClass cls = getDependsClass(val); if (cls != null) { PsiMethod[] methods = cls.findMethodsByName(methodName, true); for (PsiMethod method : methods) { if (TestNGUtil.hasTest(method, false) || TestNGUtil.hasConfig(method)) { return method; } } } return null; }