void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiElement element = startElement.getParent(); if (!(element instanceof PsiPrefixExpression prefixExpression)) { return; } final PsiExpression operand = PsiUtil.skipParenthesizedExprDown(prefixExpression.getOperand()); if (!(operand instanceof PsiConditionalExpression conditionalExpression)) { return; } final StringBuilder newExpression = new StringBuilder(); final PsiExpression condition = conditionalExpression.getCondition(); CommentTracker tracker = new CommentTracker(); newExpression.append(tracker.text(condition)).append('?'); final PsiExpression thenExpression = conditionalExpression.getThenExpression(); if (thenExpression != null) { newExpression.append(BoolUtils.getNegatedExpressionText(thenExpression, tracker)); } newExpression.append(':'); final PsiExpression elseExpression = conditionalExpression.getElseExpression(); if (elseExpression != null) { newExpression.append(BoolUtils.getNegatedExpressionText(elseExpression, tracker)); } PsiReplacementUtil.replaceExpression(prefixExpression, newExpression.toString(), tracker); }