void (List<PsiExpression> expressions, String token, boolean negate, StringBuilder out, CommentTracker tracker) { if (expressions.size() == 1) { final PsiExpression expression = expressions.get(0); if (!negate) { out.append(tracker.text(expression)); return; } if (ComparisonUtils.isComparison(expression)) { final PsiBinaryExpression binaryExpression = (PsiBinaryExpression)expression; final String negatedComparison = ComparisonUtils.getNegatedComparison(binaryExpression.getOperationTokenType()); final PsiExpression lhs = binaryExpression.getLOperand(); final PsiExpression rhs = binaryExpression.getROperand(); assert rhs != null; out.append(tracker.text(lhs)).append(negatedComparison).append(tracker.text(rhs)); } else { out.append('!').append(tracker.text(expression, ParenthesesUtils.PREFIX_PRECEDENCE)); } } else { if (negate) { out.append("!("); } boolean useToken = false; for (PsiExpression expression : expressions) { if (useToken) { out.append(token); final PsiElement previousSibling = expression.getPrevSibling(); if (previousSibling instanceof PsiWhiteSpace) { out.append(previousSibling.getText()); } } else { useToken = true; } buildSimplifiedExpression(expression, out, tracker); final PsiElement nextSibling = expression.getNextSibling(); if (nextSibling instanceof PsiWhiteSpace) { out.append(nextSibling.getText()); } } if (negate) { out.append(')'); } } }