boolean (@Nullable final PsiReference reference) { if (reference instanceof PsiJavaCodeReferenceElement && ((PsiJavaCodeReferenceElement)reference).getParent() instanceof PsiAnonymousClass) { return true; } return false; }