@Override
  public void visitMethodCallExpression(MethodCallExpression expr) {
    expr.setObjectExpression(replaceExpr(expr.getObjectExpression()));
    expr.setMethod(replaceExpr(expr.getMethod()));
    expr.setArguments(replaceExpr(expr.getArguments()));
  }
Groovy AST visitor that allows to replace both statements and expressions.

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