code: protected int removeImpl (int key, int defval)
      {
          int index = Math.abs(key)%_buckets.length;
          Record prev = null;
  
          // go through the chain looking for a match
          for (Record rec = _buckets[index]; rec != null; rec = rec.next) {
              if (rec.key == key) {
                  if (prev == null) {
                      _buckets[index] = rec.next;
                  } else {
                      prev.next = rec.next;
                  }
                  _size--;
                  return rec.value;
              }
              prev = rec;
          }
  
          return defval; // not found
      }
docs: Internal method for removing a mapping.