Helper function for creating maps and tuning them as necessary.

@param key
A key to add to the map on creation.
@param value
A value to attach to the key in the new map.
@return A new {@link Map} instance.
357661
public static Map<String, Object> newMap(String key, Object value) {
        final Map<String, Object> result = newMap();
        result.put(key, value);
        return result;
    }
633168
public void addProperty(String key, String value) {
        if (null == properties) {
            properties = new HashMap<>();
        }
        properties.put(key, value);
    }
121800
public void add(String key, String value)
    {
        if(key == null)
            throw new IllegalArgumentException("Null keys not allowed.");

        if(value == null)
            throw new IllegalArgumentException("Null values not allowed.");

        List<String> vals = map.get(key);
        if(vals == null)
        {
            vals = new ArrayList<String>();
            map.put(key,vals);
        }

        vals.add(value);
    }
369077
public ContentValues put(String key, String value) {
        mValues.put(key, value);
        return this;
    }
24604
public Object put(String key, JsonArray value) {
		if (value == null) {
			stateMap.put(key, Type.NULL);
		} else {
			stateMap.put(key, Type.ARRAY);
		}

		return super.put(key, value);
	}
220967
public JSONObject put(String key, Map<?, ?> value) throws JSONException {
		this.put(key, new JSONObject(value));
		return this;
	}
408098
public static <K,V> MapBuilder<K,V> of( K key, V value)
    {
    return new MapBuilder<K,V>().put( key, value);
    }
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);
	    }

	}
1101968
public Parameters append(String key, String value) {
        if (nameValuePairs == null) {
            nameValuePairs = new ArrayList<NameValuePair>();
        }
        nameValuePairs.add(new BasicNameValuePair(key, value));
        return this;
    }
877906
public Href with(final Object key, final Object value) {
        final SortedMap<String, List<String>> map = new TreeMap<>(this.params);
        if (!map.containsKey(key.toString())) {
            map.put(key.toString(), new LinkedList<>());
        }
        map.get(key.toString()).add(value.toString());
        return new Href(this.uri, map, this.fragment);
    }
603060
public PersistentHashArrayMappedTrie<K,V> put(K key, V value) {
    if (root == null) {
      return new PersistentHashArrayMappedTrie<>(new Leaf<>(key, value));
    } else {
      return new PersistentHashArrayMappedTrie<>(root.put(key, value, key.hashCode(), 0));
    }
  }
815808
public Object put(Object key, Object value) {
        mCacheMap.put(key, value);
        return mBackingMap.put(key, value);
    }
691018
public LiteralMapList select(String key, Object value) {
		LiteralMapList ret = new LiteralMapList();
		for (LiteralMap lm : this) {
			if (isEqual(value, lm.get(key)))
				ret.add(lm);
		}
		return ret;
	}
1293047
private static void setValue(Map<String,String> map, String key, String value) {
		map.put(key,value);
	}
124903
public static <K,V> V putAt(Map<K,V> self, K key, V value) {
        self.put(key, value);
        return value;
    }
420152
public Object put(String key, String value) {
		if (value == null) {
			stateMap.put(key, Type.NULL);
		} else {
			stateMap.put(key, Type.STRING);
		}

		return super.put(key, value);
	}
1114121
public S setParameter(String key, String value) {
        if (parameters == null) {
            parameters = new ConcurrentHashMap<String, String>();
        }
        if (value == null) {
            parameters.remove(key);
        } else {
            parameters.put(key, value);
        }
        return castThis();
    }