Adds the element to the map, and removes the old element with the same key if any.
777995
@Nullable
  public synchronized V put(K key, V value) {
    // We do remove and insert instead of just replace, in order to cause a structural change
    // to the map, as we always want the latest inserted element to be last in the queue.
    V oldValue = mMap.remove(key);
    mSizeInBytes -= getValueSizeInBytes(oldValue);
    mMap.put(key, value);
    mSizeInBytes += getValueSizeInBytes(value);
    return oldValue;
  }
135975
public V put(final int key, final V value) {
		int index = (key & 0x7FFFFFFF) % elementData.length;

		IntLinkedEntry<V> entry = elementData[index];
		while (entry != null && key != entry.key) {
			entry = entry.nextInSlot;
		}

		if (entry == null) {
			// Remove eldest entry if instructed, else grow capacity if appropriate
			IntLinkedEntry<V> eldest = header.after;
			++elementCount;
			if (removeEldestEntry(eldest)) {
				remove(eldest.key);
			} else {
				if (elementCount > threshold) {
					rehash();
					index = (key & 0x7FFFFFFF) % elementData.length;
				}
			}
			entry = createHashedEntry(key, index);
		}

		V result = entry.value;
		entry.value = value;
		return result;
	}
906753
public int put(Object key, int value)
  {
    if (key == null)
      key = NULL_KEY;

    synchronized (this) {
      int hash = key.hashCode() & _mask;

      for (Item item = _entries[hash]; item != null; item = item._next) {
        Object testKey = item._key;

        if (testKey == key || testKey.equals(key)) {
          int oldValue = item._value;

          item._value = value;

          return oldValue;
        }
      }

      Item item = new Item(key, value);
      item._next = _entries[hash];

      _entries[hash] = item;

      _size++;
    }

    return NULL;
  }
264922
function(key, value) {
        this._removeRemove(this.sets.remove, key);
        var op = this._getOp(this.sets.adds, key);
        if (op) {
            op.add.push(value);
        } else {
            this.sets.adds.push({key: key, add: [value]});
        }
        return this;
    }
509503
public boolean add(final K key, final V value) {
        if (!this.map.containsKey(key)) {
            this.map.put(key, new ArrayList<V>());
        }
        return this.map.get(key).add(value);
    }
909129
public synchronized void add(T element) {

    Assert.notNull(element, "Element cannot be null");

    int filterSize = getFilterSize();
    int hashFunctionCount = getHashFunctionCount(element);

    this.random.setSeed(element.hashCode());

    for (int count = 0; count < hashFunctionCount; count++) {
      int bitIndex = this.random.nextInt(filterSize);
      this.bitArray[bitIndex / 32] |= BIT_MASKS[bitIndex % 32];
    }
  }
949113
def _remove_add_key(self, key):
        """"""
        if not hasattr(self, '_queue'):
            return  # haven't initialized yet, so don't bother
        if key in self._queue:
            self._queue.remove(key)
        self._queue.append(key)
        if self.maxsize == 0:
            return
        while len(self._queue) > self.maxsize:
            del self[self._queue[0]]
1018605
@SuppressWarnings("unchecked")
  public boolean remove(final Object key) {
    // validate key
    if (key == null) {
      throw new IllegalArgumentException("Null element is not supported.");
    }
    LinkedElement<T> removed = removeElem((T) key);
    shrinkIfNecessary();
    return removed == null ? false : true;
  }
655928
function(key) {
        this._removeAddsOrRemoves(this.flags.set, key);
        if (this.flags.remove.indexOf(key) === -1) {
            this.flags.remove.push(key);
        }
        return this;
    }
267459
public synchronized void removeElement(T element) {
		List<T> origList = ref.get().list;
		boolean isPresent = origList.contains(element);
		if (!isPresent) {
			return;
		}
		
		List<T> newList = new ArrayList<T>(origList);
		newList.remove(element);
		
		swapWithList(newList);
	}
1291792
public synchronized void remove(Object key)
	{
		final Object o = map.remove(key);
		if (o != null)
			tree.remove(o);
	}
1110021
private void add(TreeMap<String, Object> map, String key, Object value) {
		// ZAP: Added the type argument.
	    Vector<Object> v = getList(map, key);
	    if (v == null) {
	    	// ZAP: Added the type argument.
	        v = new Vector<>();
	        synchronized (map) {
	            map.put(key, v);
	        }
	    }
	    if (!v.contains(value)) {
	        v.add(value);
	    }

	}
1089922
public function add($element, $key = null)
    {
        if ($key == null) {
            $this->items[] = $element;

            return;
        }
        $this->set($key, $element);
    }
369968
public T put(final int key, final T value) {
		int index = ((key & 0x7FFFFFFF) % elementKeys.length);
		T oldvalue = null;

		long entry = elementKeys[index];
		if (entry == Integer.MIN_VALUE) {
			++elementCount;
		} else {
			oldvalue = elementValues[index];
			collisions++;
		}
		elementKeys[index] = key;
		elementValues[index] = value;
		return oldvalue;
	}
814261
public void add(K key, V value) {
    if (treatCollectionsAsImmutable) {
      Collection<V> newC = cf.newCollection();
      Collection<V> c = map.get(key);
      if (c != null) {
        newC.addAll(c);
      }
      newC.add(value);
      map.put(key, newC); // replacing the old collection
    } else {
      Collection<V> c = map.get(key);
      if (c == null) {
        c = cf.newCollection();
        map.put(key, c);
      }
      c.add(value); // modifying the old collection
    }
  }
247971
@SuppressWarnings("unchecked")
    public V put(final int key, final V value) {
        checkNotNull(value, "Value cannot be null");
        V oldValue = null;
        int index = intHash(key, mask);
        while (null != values[index]) {
            if (key == keys[index]) {
                oldValue = (V) values[index];
                break;
            }
            index = ++index & mask;
        }
        if (null == oldValue) {
            ++size;
            keys[index] = key;
        }
        values[index] = value;
        if (size > resizeThreshold) {
            increaseCapacity();
        }
        return oldValue;
    }
90202
public void add(long date, T element) {
		if (size == 0) {
			elements[0] = element;
			dates[0] = date;
			size = 1;
			oldestIndex = 0;
			newestIndex = 0;
			return;
		}
		if (size < elements.length) {
			elements[size] = element;
			dates[size] = date;
			if (date < dates[oldestIndex]) oldestIndex = size;
			if (date > dates[newestIndex]) newestIndex = size;
			size++;
			return;
		}
		if (dates[oldestIndex] > date) {
			// older than oldest
			if (newestIndex < 0) refreshNewestIndex();
			elements[newestIndex] = element;
			dates[newestIndex] = date;
			oldestIndex = newestIndex;
			newestIndex = -1;
			return;
		}
		if (newestIndex < 0) refreshNewestIndex();
		if (dates[newestIndex] < date) return; // newer than newest
		// replace the newest
		elements[newestIndex] = element;
		dates[newestIndex] = date;
		oldestIndex = newestIndex;
		newestIndex = -1;
		return;
	}