BaseExpression (closure generator) and tests