ensureTransformedList_(statements) {
    let maybeTransformedStatements = [];
    let foundMachine = false;
    for (let i = 0; i < statements.length; i++) {
      let statement = statements[i];
      let maybeTransformedStatement = this.maybeTransformStatement_(statement);
      maybeTransformedStatements.push(maybeTransformedStatement);
      if (maybeTransformedStatement.type === STATE_MACHINE) {
        foundMachine = true;
      }
    }
    if (!foundMachine) {
      return this.statementsToStateMachine_(statements);
    }

    return this.transformStatementList_(maybeTransformedStatements);
  }
Ensure that a statement has been transformed into a state machine.
@param {Array.<ParseTree>} statements
@return {StateMachine}