@Override
  @SuppressWarnings("unchecked")
  public void visitTryCatchFinally(TryCatchStatement stat) {
    stat.setTryStatement(replace(stat.getTryStatement()));
    replaceAll(stat.getCatchStatements());
    stat.setFinallyStatement(replace(stat.getFinallyStatement()));
  }
Groovy AST visitor that allows to replace both statements and expressions.

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