void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { PsiConditionalExpression expression = ObjectUtils.tryCast(startElement.getParent(), PsiConditionalExpression.class); if (expression == null) return; ConditionalModel model = ConditionalModel.from(expression); if (model == null) return; ConditionalExpressionGenerator generator = ConditionalExpressionGenerator.from(model); if (generator == null || generator.getTokenType().equals("?:")) return; CommentTracker tracker = new CommentTracker(); final String newExpression = generator.generate(tracker); PsiReplacementUtil.replaceExpression(expression, newExpression, tracker); }