static compareReferences(first, second) {
    const isSegment = first instanceof shaka.media.SegmentReference &&
        second instanceof shaka.media.SegmentReference;
    const isInit = first instanceof shaka.media.InitSegmentReference &&
        second instanceof shaka.media.InitSegmentReference;
    if (isSegment || isInit) {
      const firstRef = /** @type {shaka.media.AnySegmentReference} */(first);
      const secondRef = /** @type {shaka.media.AnySegmentReference} */(second);
      const a = firstRef.getUris();
      const b = secondRef.getUris();
      if (typeof a !== 'object' || typeof b !== 'object' ||
          typeof a.length != 'number' || typeof b.length !== 'number') {
        return false;
      }
      if (a.length != b.length ||
          !a.every((x, i) => { return x == b[i]; })) {
        return false;
      }

      // Make shallow copies of each, without their getUris fields.
      // Also remove mimeType and codecs.
      const trimmedFirst = Object.assign({}, /** @type {Object} */(firstRef));
      delete trimmedFirst['getUris'];
      delete trimmedFirst['getUrisInner'];
      delete trimmedFirst['mimeType'];
      delete trimmedFirst['codecs'];
      const trimmedSecond = Object.assign({}, /** @type {Object} */(secondRef));
      delete trimmedSecond['getUris'];
      delete trimmedSecond['getUrisInner'];
      delete trimmedSecond['mimeType'];
      delete trimmedSecond['codecs'];

      // Compare those using Jasmine's utility, which will compare the fields of
      // an object and the items of an array.
      const customEqualityTesters = [
        shaka.test.Util.compareReferences,
      ];
      return jasmine.matchersUtil.equals(
          trimmedFirst, trimmedSecond, customEqualityTesters);
    }

    return undefined;
  }
Custom comparer for segment references.
@param {*} first
@param {*} second
@return {boolean|undefined}