remove(key) {
    const entry = this.entries_[key];
    assert(
      entry !== undefined,
      'Tried to get a value for a key that does not exist in the cache',
    );
    if (entry === this.newest_) {
      this.newest_ = /** @type {Entry} */ (entry.older);
      if (this.newest_) {
        this.newest_.newer = null;
      }
    } else if (entry === this.oldest_) {
      this.oldest_ = /** @type {Entry} */ (entry.newer);
      if (this.oldest_) {
        this.oldest_.older = null;
      }
    } else {
      entry.newer.older = entry.older;
      entry.older.newer = entry.newer;
    }
    delete this.entries_[key];
    --this.count_;
    return entry.value_;
  }
Remove an entry from the cache.
@param {string} key The entry key.
@return {T} The removed entry.