@Override
  public void visitSynchronizedStatement(SynchronizedStatement stat) {
    stat.getExpression().visit(this);
    stat.setCode(replace(stat.getCode()));
  }
Replaces the currently visited statement with the specified statement.
spock-core/src/main/java/org/spockframework/compiler/StatementReplacingVisitorSupport.java