public Object put(int key, Object value) {

    Entry[] table = this.table;

    // Is the key already in the table?
    int bucket = Math.abs(key) % table.length;
    for (Entry e = table[bucket]; e != null; e = e.next) {
      if (e.key == key) {
        Object old = e.value;
        e.value = value;
        return old;
      }
    }

    // Adjust the table, if necessary
    if (count >= threshold) {
      rehash();
      table = this.table;
      bucket = Math.abs(key) % table.length;
    }

    Entry e = new Entry();
    e.key = key;
    e.value = value;
    e.next = table[bucket];
    table[bucket] = e;
    count++;
    return null;
  }
Creates a mapping between the given key (object id) and an object. Returns the previous value,
or <code>null</code> if there was none.

@throws IllegalArgumentException <code>key</code> is less than zero
geode-core/src/main/java/org/apache/geode/internal/admin/ListenerIdMap.java