boolean (PsiElement exp) { for (PsiField field : fields) { if (PsiTreeUtil.isAncestor(field, exp, false)) { return true; } } for (PsiMethod method : methods) { if (PsiTreeUtil.isAncestor(method, exp, false)) { return true; } } return false; }