removeImpl(type, start, end, continuityTimelines) {
    if (!this.segments[type]) {
      throw new Error('unexpected type');
    }

    const first = this.toIndex_(type, start);
    if (first < 0 || first >= this.segments[type].length) {
      throw new Error('unexpected start');
    }

    // Note: |end| is exclusive.
    const last = this.toIndex_(type, end - 0.000001);
    if (last < 0) {
      throw new Error('unexpected end');
    }

    if (first > last) {
      throw new Error('unexpected start and end');
    }

    for (let i = first; i <= last; ++i) {
      this.segments[type][i] = false;
    }

    return Promise.resolve();
  }
@param {string} type
@param {number} start
@param {number} end
@param {Array<number>=} continuityTimelines
@return {!Promise}