boolean (@NotNull PsiElement psiElement) { PsiElement parentElement = psiElement.getParent(); if (parentElement instanceof PsiConditionalExpression) return true; PsiPolyadicExpression parentExpr = ObjectUtils.tryCast(parentElement, PsiPolyadicExpression.class); return parentExpr != null && parentExpr.getParent() instanceof PsiConditionalExpression; }