replaceAndAddStates_(oldStates, oldState, newState, newStates) {
    for (let i = 0; i < oldStates.length; i++) {
      newStates.push(oldStates[i].replaceState(oldState, newState));
    }
  }
@param {Array.<State>} oldStates
@param {number} oldState
@param {number} newState
@param {Array.<State>} newStates