boolean (GrExpression expression) { if (expression instanceof GrBinaryExpression binaryExpression) { final IElementType sign = binaryExpression.getOperationTokenType(); return GroovyTokenTypes.mLAND.equals(sign) || GroovyTokenTypes.mLOR.equals(sign); } else if (expression instanceof GrUnaryExpression prefixExpression) { final IElementType sign = prefixExpression.getOperationTokenType(); return GroovyTokenTypes.mLNOT.equals(sign); } else if (expression instanceof GrParenthesizedExpression parenthesizedExpression) { final GrExpression contents = parenthesizedExpression.getOperand(); return isBoolean(contents); } return false; }