boolean (@NotNull PsiElement position) { PsiElement nextLeaf = PsiTreeUtil.nextLeaf(position); if (nextLeaf == null) return false; PsiElement parent = nextLeaf.getParent(); if (!(parent instanceof PsiJavaCodeReferenceElement)) return false; PsiElement grandParent = parent.getParent(); if (!(grandParent instanceof PsiTypeElement)) return false; return PsiTreeUtil.skipWhitespacesAndCommentsForward(grandParent) instanceof PsiIdentifier; }