Given a multimap that uses sets to collect values,
adds the value to the set for the given key.
777396
function multiMapSet(multimap, key, value) {
  if (!multimap.has(key)) {
    multimap.set(key, new Set());
  }
  const values = multimap.get(key);
  if (!values.has(value)) {
    values.add(value);
    return true;
  }
  return false;
}
926151
public V put (K key, V value)
    {
        SoftReference<V> old = _map.put(key, createReference(value));
        return (old == null) ? null : old.get();
    }
968042
function set(Key, MaybeValue) {

        flocksLog(3, " - Flocks2 multi-set");

        if (typeof Key === "string")      { return setByKey(Key, MaybeValue); }
        else if (isArray(Key))            { return setByPath(Key, MaybeValue); }
//      else if (isNonArrayObject(Key))   { return setByObject(Key); }              // todo
        else                              { throw "Flocks2 set/1,2 key must be a string or an array"; }

    }
1355165
public static void addValue(String key, Object value, MultiValueMap<String, String> params) {
        if (value != null) {
            params.add(key, value.toString());
        }
    }
803355
public MapBuilder<K,V> put( K key, V value)
    {
    map_.put( key, value);
    return this;
    }
783840
public void addAll(Set<? extends E> set) {
		if(set.size()<=MAXIMUM_COMBINE_SIZE) {
			if(combined==null) combined = new HashSet<>(set);
			else combined.addAll(set);
		} else {
			added.add(set);
		}
	}
3716
public void addSet(final SortedSet<T> set) {
        SortedMap<T, UBNode<T>> nodes = rootNodes;
        UBNode<T> node = null;
        for (T element : set) {
            node = nodes.get(element);
            if (node == null) {
                node = new UBNode<>(element);
                nodes.put(element, node);
            }
            nodes = node.children();
        }
        if (node != null) {
            node.setEndSet(set);
        }
    }
1242489
public static <K, V> void putSet(Map<K, Set<V>> map, K key, V valueElt) {
        if (map.containsKey(key)) {
            Set<V> l = map.get(key);
            l.add(valueElt);
        } else {
            Set<V> l = new HashSet<>();
            l.add(valueElt);
            map.put(key, l);
        }
    }
1292047
function stackSet(key, value) {
  var data = this.__data__;
  if (data instanceof _ListCache) {
    var pairs = data.__data__;
    if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
      pairs.push([key, value]);
      this.size = ++data.size;
      return this;
    }
    data = this.__data__ = new _MapCache(pairs);
  }
  data.set(key, value);
  this.size = data.size;
  return this;
}
1238214
public static <K1, V1, K2, V2> MutableMap<K2, V2> collect(
            Map<K1, V1> map,
            Function<? super K1, ? extends K2> keyFunction,
            Function<? super V1, ? extends V2> valueFunction)
    {
        return MapIterate.collect(map, keyFunction, valueFunction, UnifiedMap.<K2, V2>newMap());
    }
154812
public static Set<Map<String, Object>> setify(ObjectMapper mapper, Object source) {
        return (Set<Map<String, Object>>) collectify(mapper, source, Set.class);
    }
155156
public void add(Object key, Object value) {
        Object existing = mMap.get(key);
        if (existing instanceof List) {
            if (value instanceof List) {
                ((List)existing).addAll((List)value);
            }
            else {
                ((List)existing).add(value);
            }
        }
        else if (existing == null && !mMap.containsKey(key)) {
            if (value instanceof List) {
                mMap.put(key, new ArrayList((List)value));
            }
            else {
                mMap.put(key, value);
            }
        }
        else {
            List list = new ArrayList();
            list.add(existing);
            if (value instanceof List) {
                list.addAll((List)value);
            }
            else {
                list.add(value);
            }
            mMap.put(key, list);
        }
    }
344762
private MValue setInMap(String key, MValue value) {
        newKey.add(key);
        valueMap.put(key, value);
        return value;
    }
1373777
public static <K, V> Set<Map<K, V>> setify(ObjectMapper mapper, Object source, Class<K> targetKeyType, Class<V> targetValueType) {
        return (Set<Map<K, V>>) collectify(mapper, source, Set.class, targetKeyType, targetValueType);
    }
824837
public SetMultimap<A, B> getKeyValueMultimap() {
    SetMultimap<A, B> map = HashMultimap.create();
    for (A key : keySet()) {
      for (B value : getValues(key)) {
        map.put(key, value);
      }
    }
    return map;
  }
541628
public ValueMap withStringSet(String key, Set<String> val) {
        super.put(key, val);
        return this;
    }
1192219
public Environment add(@NonNull String key, @NonNull Object value) {
        return set(key, value);
    }