replaceAllStates(oldState, newState) {
    return State.replaceStateList(this.tryStates, oldState, newState);
  }
Helper for replaceState.
@param {number} oldState
@param {number} newState
@return {Array.<number>}