@SuppressWarnings("unchecked")
  protected <T extends Statement> void replaceAll(List<T> stats) {
    ListIterator<T> iter = stats.listIterator();
    while (iter.hasNext())
      iter.set((T) replace(iter.next()));
  }
Visits the statements in the specified mutable list. If a statement's
visit method calls replaceVisitedMethodWith(), the statement will be
replaced.
spock-core/src/main/java/org/spockframework/compiler/StatementReplacingVisitorSupport.java