Adds the {@code key, value} pair. If {@code key} already has values, {@code value} is added to
the end. Duplicate values for the same key are permitted.

@throws NullPointerException if key or value is null
507675
public <T> void put(Key<T> key, T value) {
    Preconditions.checkNotNull(key, "key");
    Preconditions.checkNotNull(value, "value");
    maybeExpand();
    name(size, key.asciiName());
    value(size, key.toBytes(value));
    size++;
  }
452433
public V put(final Object key, final Object value)
    {
        final Object val = mapNullValue(value);
        requireNonNull(val, "value cannot be null");

        final Object[] entries = this.entries;
        final int mask = entries.length - 1;
        int index = Hashing.evenHash(key.hashCode(), mask);
        Object oldValue = null;

        while (entries[index + 1] != null)
        {
            if (entries[index] == key || entries[index].equals(key))
            {
                oldValue = entries[index + 1];
                break;
            }

            index = next(index, mask);
        }

        if (oldValue == null)
        {
            ++size;
            entries[index] = key;
        }

        entries[index + 1] = val;

        increaseCapacity();

        return unmapNullValue(oldValue);
    }
771225
<T> void setValueInternal(String key, T value) {
		if (key == null) {
			throw new NullPointerException("Key must not be null.");
		}
		if (value == null) {
			throw new NullPointerException("Value must not be null.");
		}

		synchronized (this.confData) {
			this.confData.put(key, value);
		}
	}
1062867
public V put(K key, V value) {

        if ((key != null) && (value != null)) {
            return m_internalMap.put(key, value);
        }
        Exception e = new Exception();
        try {
            // we want to print a stack trace when null is used as a key/value
            throw e;
        } catch (Exception e2) {
            e = e2;
        }
        if (key == null) {
            LOG.warn("Invalid null key in map", e);
            return null;
        }
        if (value == null) {
            LOG.warn("Invalid null value in map", e);
            return m_internalMap.remove(key);
        }
        return null;
    }
180457
public void put(K key, V value) {
        Set<V> set = storage.get(key);
        if (set == null) {
            set = new HashSet<>();
            storage.put(key, set);
        }
        set.add(value);
    }
462949
private static void appendKeyValue(StringBuffer str, String key, String value) {

        str.append(key);
        if (value == IS_USED) {
            str.append(";");
        } else {
            str.append("=(");
            str.append(value);
            str.append(");");
        }
    }
984757
private void addToJsonArray(String key, JsonValue value){
        if (value == null){
            throw new NullPointerException("Value cannot be null.");
        }
        
        PiwikJsonArray a = (PiwikJsonArray)parameters.get(key);
        if (a == null){
            a = new PiwikJsonArray();
            parameters.put(key, a);
        }
        a.add(value);
    }
1286248
private void addElement(String key, String value) {
        this.num_items++;
        List<String> vals = this.values.get(key);
        if (null == vals) {
            vals = new LinkedList<String>();
        }
        if (null == value) {
            vals.add("\"\"");
        } else {
            vals.add(value);
        }
        this.values.put(key, vals);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "addElement: " + key + "=" + value + " num: " + this.num_items);
        }
    }
33800
public void append(StringBuilder buffer, Object value) {
        if (buffer == null) {
            throw new NullPointerException("buffer");
        }

        buffer.append(value);
    }
347583
public static void addValueIfNotNull( @Nonnull Map<String, String> parameters, @Nonnull String key, Object value ) {
        if( value == null ) {
            return;
        }
        parameters.put(key, value.toString());
    }
457727
public void put(Object key, Object value)
    {
        keyTable.put(key, value);
        valueTable.put(value, key);
    }
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);
    }
86960
public void addValueToKey(K key, V value) {
        this.addValuesToKey(key, Collections.singletonList(value));
    }
893195
public void add(final String name, final String value) {
    ArrayList<String> values = super.get(name);
    if (values == null) {
      values = new ArrayList<String>(1);  // Often there's only 1 value.
      super.put(name, values);
    }
    values.add(value);
  }
1329697
public V put(String key, V value) {

	if (key == null || value == null) {
	    throw new NullPointerException("keys and values cannot be null");
	}

	int keyLength = key.length();
	Node<V> n = rootNode;

	for (int curKeyIndex = 0; curKeyIndex <= keyLength; ++curKeyIndex) {	    

	    CharSequence nodePrefix = n.getPrefix();

	    int nextCharIndex = curKeyIndex + 1;

	    // if the current node is an intermediate node, then we need to
	    // match all of the prefix characters to use its children.  
	    if (nodePrefix.length() > 0) {
		int charOverlap = countOverlap(key, curKeyIndex, nodePrefix,0);
		int prefixLength = nodePrefix.length();
		
		// if 0 ore more characters overlapped, add this node to
		// somewhere in the middle
		if (charOverlap < prefixLength) {
		    addIntermediateNode(n,
					charOverlap,
					key,
					curKeyIndex,
					value);
		    size++;
		    return null;
		}

		// if all of the characters overlapped, then lookup the
		// transition to the next node based on the next character after
		// the matching prefix
		curKeyIndex += prefixLength;
		nextCharIndex = curKeyIndex + 1;
	    }

	    // If we have exhausted all the characters in the key, then the
	    // current node should map to the value
	    if (curKeyIndex == keyLength) {
		return replaceValue(n, value);
	    }
	    	    
	    // Otherwise, more characters exist, so check to see if there is a
	    // transition from the next sequence of the key to node.  If so, we
	    // use this to keep searching for the key's node
	    else {
		Node<V> child = n.getChild(key.charAt(curKeyIndex));
		
		// if there was no other node to transition to, then the
		// remaining portion of the key is used to form a child node of
		// the current node.  Since this is a new mapping, we can return
		// null immediately.
		if (child == null) {
		    addChildNode(n, key, curKeyIndex, value);
		    return null;
		}
		// otherwise, update the current node to the child and repeat
		// the search process
		else {
		    n = child;
		}
	    }	    
	}

	// NOTE: we should never reach this case, as the one of the conditions
	// in the for loop will determine where the key goes.
	return null;
    }
1246480
@Override
	public final boolean put(String key, Bitmap value) {
		if (key == null || value == null) {
			throw new NullPointerException("key == null || value == null");
		}

		synchronized (this) {
			size += sizeOf(key, value);
			Bitmap previous = map.put(key, value);
			if (previous != null) {
				size -= sizeOf(key, previous);
			}
		}

		trimToSize(maxSize);
		return true;
	}
482798
public void put(T key, Object value) {
        data.put(key, ensureValueCorrectness(key, value));
    }