void (@NotNull PsiBinaryExpression visitedElement, @NotNull PsiBinaryExpression lBinaryExpression, @NotNull PsiExpression duplicateExpression, @NotNull PsiExpression thenExpression, @NotNull PsiExpression elseExpression, boolean isFactorizedExpressionFirst) { CommentTracker commentTracker = new CommentTracker(); if (isFactorizedExpressionFirst) { PsiReplacementUtil.replaceExpression(visitedElement, commentTracker.text(duplicateExpression, ParenthesesUtils.getPrecedence(lBinaryExpression)) + getOperatorText(lBinaryExpression) + '(' + commentTracker.text(thenExpression, ParenthesesUtils.getPrecedence(visitedElement)) + getOperatorText(visitedElement) + commentTracker.text(elseExpression, ParenthesesUtils.getPrecedence(visitedElement)) + ')', commentTracker); } else { PsiReplacementUtil.replaceExpression(visitedElement, '(' + commentTracker.text(thenExpression, ParenthesesUtils.getPrecedence(visitedElement)) + getOperatorText(visitedElement) + commentTracker.text(elseExpression, ParenthesesUtils.getPrecedence(visitedElement)) + ')' + getOperatorText(lBinaryExpression) + commentTracker.text(duplicateExpression, ParenthesesUtils.getPrecedence(lBinaryExpression)), commentTracker); } }