private Expression unrecord(Expression expr) {
    if (!(expr instanceof MethodCallExpression)) return expr;
    MethodCallExpression methodExpr = (MethodCallExpression) expr;
    Expression targetExpr = methodExpr.getObjectExpression();
    if (!(targetExpr instanceof VariableExpression)) return expr;
    VariableExpression var = (VariableExpression)targetExpr;
    if (!valueRecorderName.equals(var.getName())) return expr;
    if(!ValueRecorder.RECORD.equals(methodExpr.getMethodAsString())) return expr;
    return ((ArgumentListExpression)methodExpr.getArguments()).getExpression(1);
  }
Rewrites explicit ("assert x > 3") and implicit ("x > 3") condition
statements. Replacing the original statement with the rewritten one is up
to clients.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/compiler/ConditionRewriter.java