String (GrExpression condition) { if (isNegation(condition)) { final GrExpression negated = getNegated(condition); return negated.getText(); } else if (ComparisonUtils.isComparison(condition)) { final GrBinaryExpression binaryExpression = (GrBinaryExpression) condition; final IElementType sign = binaryExpression.getOperationTokenType(); final String negatedComparison = ComparisonUtils.getNegatedComparison(sign); final GrExpression lhs = binaryExpression.getLeftOperand(); final GrExpression rhs = binaryExpression.getRightOperand(); assert rhs != null; return lhs.getText() + negatedComparison + rhs.getText(); } else if (ParenthesesUtils.getPrecedence(condition) > ParenthesesUtils.PREFIX_PRECEDENCE) { return "!(" + condition.getText() + ')'; } else { return '!' + condition.getText(); } }