boolean (@Nullable PsiElement leaf) { if (leaf == null) return false; if (leaf.getNode().getElementType() == JavaTokenType.RPARENTH) return true; PsiElement next = PsiTreeUtil.nextVisibleLeaf(leaf); if (next == null) return false; return next.getNode().getElementType() == JavaTokenType.RPARENTH; }