String (boolean invert) { if (myLimit < 0) { return invert ? BoolUtils.getNegatedExpressionText(myCondition) : myCondition.getText(); } PsiPolyadicExpression condition = (PsiPolyadicExpression)myCondition; PsiExpression[] operands = condition.getOperands(); String joiner = (condition.getOperationTokenType() == JavaTokenType.ANDAND) != invert ? "&&" : "||"; return StreamEx.of(operands, 0, myLimit).map(invert ? BoolUtils::getNegatedExpressionText : PsiExpression::getText) .joining(joiner); }