@Override
  public void visitIfElse(IfStatement stat) {
    stat.getBooleanExpression().visit(this);
    stat.setIfBlock(replace(stat.getIfBlock()));
    stat.setElseBlock(replace(stat.getElseBlock()));
  }
Replaces the currently visited statement with the specified statement.
spock-core/src/main/java/org/spockframework/compiler/StatementReplacingVisitorSupport.java