private void addResponses() {
    for (InteractionResponse response : responses) {
      if (response.iterable) {
        call(resources.getAstNodeCache().InteractionBuilder_AddIterableResponse, response.expr);
      } else if (response.expr instanceof ClosureExpression) {
        call(resources.getAstNodeCache().InteractionBuilder_AddCodeResponse, response.expr);
      } else {
        call(resources.getAstNodeCache().InteractionBuilder_AddConstantResponse, response.expr);
      }
    }
  }
If the given statement is a valid interaction definition, returns the rewritten statement.
If the given statement is not an interaction definition, returns null.
If the given statement is an invalid interaction definition, records a compile error
and returns null.
spock-core/src/main/java/org/spockframework/compiler/InteractionRewriter.java