constructor(headers) {
    this.contents = {};

    if (headers) {
      if (headers instanceof jasmine.Fetch.Headers) {
        // Extract contents, to be read as a generic object below.
        headers = headers.contents;
      }
      if (Array.isArray(headers)) {
        for (const header of headers) {
          this.append(header[0], header[1]);
        }
      } else {
        for (const name of Object.getOwnPropertyNames(headers)) {
          this.append(name, headers[name]);
        }
      }
    }
  }
@param {(!Array<!Array<string>>|Headers|Object<string,string>)=} headers