@Override
  public void visitWhileLoop(WhileStatement stat) {
    stat.getBooleanExpression().visit(this);
    stat.setLoopBlock(replace(stat.getLoopBlock()));
  }
Replaces the currently visited statement with the specified statement.
spock-core/src/main/java/org/spockframework/compiler/StatementReplacingVisitorSupport.java