boolean (@NotNull final T t, final ProcessingContext context) { if (!(t instanceof PsiIdentifier)) return false; final PsiElement parent = t.getParent(); if (parent instanceof PsiClass && t != ((PsiClass) parent).getNameIdentifier()) return false; if (parent instanceof PsiMethod && t != ((PsiMethod) parent).getNameIdentifier()) return false; if (parent instanceof PsiVariable && t != ((PsiVariable) parent).getNameIdentifier()) return false; return pattern.accepts(parent, context); }