Changes the the values in the nested collection
@param {Immutable.Map} map     - [description]
@param {Array}         listKey - [description]
@param {Array}         keyPath - [description]
@param {*|Function}    value   - [description]
3906
function setDeep(map, listKey, keyPath, value) {
  if (!Array.isArray(listKey)) {
    listKey = [listKey];
  }
  var change = typeof value === 'function' ? 'updateIn' : 'setIn';
  var subPaths = getPaths(map, listKey, keyPath);
  return map.withMutations(function (map) {
    subPaths.forEach(function (keyPath) {
      return map[change](keyPath, value);
    });
  });

  function getPaths(map, listKeys, keyPath) {
    var overview = arguments.length <= 3 || arguments[3] === undefined ? [keyPath] : arguments[3];

    var list = map.getIn(listKeys);
    if (list) {
      var size = list.size;
      for (var i = 0; i < size; i++) {
        overview.push([].concat(_toConsumableArray(listKeys), [i], _toConsumableArray(keyPath)));
        getPaths(map, [].concat(_toConsumableArray(listKeys), [i, listKeys[0]]), keyPath, overview);
      }
    }
    return overview;
  }
}
1037757
public static <K, V> void putSetMult(Map<K, Set<V>> map, K key,
            Collection<? extends V> values) {
        for (V value : values) {
            putSet(map, key, value);
        }
    }
49201
function(key, value, callback) {
        if (this.get(key) == value) {
            return;
        }

        this.set(key, value);
        clearTimeout(this._saveTimeout);
        this._saveTimeout = setTimeout(_.bind(function() {
            fs.writeFile(this._stateFile, JSON.stringify(this.attributes, null, '\t'), _.bind(function() {
                logger.info(key + ' saved to ' + path.join(process.cwd(), this._stateFile));
                while (this._callbacks && this._callbacks.length) {
                    this._callbacks.shift()();
                }
            }, this));
        }, this), 1000);

        if (callback) {
            if (!this._callbacks) {
                this._callbacks = [];
            }

            this._callbacks.push(callback);
        }
    }
484704
protected final void mapUpdate(Map map, Object key, Object value) {
        Object o = map.get(key);
        /*
          If a value exists in map.get(key), convert the "value" parameter into
          the type of map.get(key).  It's a best guess as to what the type of the
          Map _should_ be without any further reflective information about the
          types contained in the map.
         */
        if(o != null) {
            Class type = o.getClass();
            value = ParseUtils.convertType(value, type);
        }

        map.put(key, value);
    }
1273999
public void replaceValues(String key, Object value) {
//    fields.replaceValues(key, Collections.singletonList(value)); // unnecessarily slow
    List<Object> list = fields.get(key);
    list.clear(); 
    list.add(value);
  }
71160
function (map, array) {
                if (map == null)
                    return;
                for (var i in map) {
                    var item = map[i];
                    var key = item.key;
                    if (map == this._objectKeys) {
                        key[this._metaDataName] = null;
                        delete item.key[this._metaDataName];
                    }
                    while (item) {
                        array.push(item.value);
                        item.value = null;
                        item.key = null;
                        var next = item.next;
                        item.next = null;
                        item = next;
                    }
                    map[i] = null;
                    delete map[i];
                }
            }
1248104
@SuppressWarnings({"unchecked", "rawtypes"})
    private void populateMap(Map map, Node node) {
        Map.Entry entry = getMapEntry(node);
        if (entry != null) {
            map.put(entry.getKey(), entry.getValue());
        }
    }
479926
protected void putValue(K key, MapEntryValue value) {
    MapEntryValue oldValue = entries().put(key, value);
    cancelTtl(oldValue);
    scheduleTtl(key, value);
  }
1076162
public static void addValues(String key, Collection<String> values, MultiValueMap<String, String> params) {
        if (values != null) {
            for (String value : values) {
                params.add(key, value);
            }
        }
    }
1247459
private void onKeyUpdated(final int index, final Map.Entry<String, String> object, final String value) {
        final HashMap<String, String> _m = new LinkedHashMap<String, String>(getValue());
        final String lastKeyValue = object.getKey();
        String mapValue = "";
        if (lastKeyValue != null) {
            mapValue = _m.remove(lastKeyValue);
        }
        _m.put(value, mapValue);
        setValue(_m, true);
    }
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;
}
1293047
private static void setValue(Map<String,String> map, String key, String value) {
		map.put(key,value);
	}
133589
public <T> void set(EventLocal<T> key, Object value) {
        EventLocalMap<EventLocal<?>, Object> map = getMap(key);
        if (null == map) {
            // the call to getMap would have created the inheritable map
            // if appropriate, thus always create a disconnected map here
            map = new EventLocalMap<EventLocal<?>, Object>();
            if (key.isInheritable()) {
                this.inheritableLocals = map;
            } else {
                this.locals = map;
            }
        }
        map.put(key, value);
    }
148393
@SuppressWarnings("unchecked")
    private static void setMapParam(Field field, List<?> values) {
        try {
            // Find Map method: put(Object, Object)
            Class<?> fieldClass = field.getType();
            Method addMethod = fieldClass.getMethod("put", Object.class, Object.class);
            
            // Add each map key/value to field value
            for (Object subParam : values) {
                if (subParam instanceof Map) {
                    Map<String, ?> map = (Map<String, ?>)subParam;
                    for (String key : map.keySet()) {
                        Object value = map.get(key);
                        if (value instanceof List) {
                            // Contains a single element, which is a key/value map
                            value = ((List<?>)value).get(0);
                        }
                        addMethod.invoke(field.get(config), key, value);
                    }
                } else {
                    throw new RuntimeException("Unexpected collection parameter type for '" + field.getName() + ":" + subParam);
                }
            }
        } catch (NoSuchMethodException  | IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
            throw new RuntimeException("Error setting configuration parameter '" + field.getName() + "'", e);
        }
    }
222145
private static <K, V> void set(Map<K, Set<V>> map, K key, V value) {
    Set<V> values = map.get(key);
    if (values == null) {
      values = new HashSet<>();
      map.put(key, values);
    }
    values.add(value);
  }
1057661
function PathValue( parent, value, key ) {
        this._parent = parent;
        // Object.defineProperty( this, '_parent', { value: parent });
        this._value = value;
        this._key = key;
    }
787484
public static <T, K> boolean move(List<T> list, K key,
			Function<T, K> keyMapper, int n) {
		if (n == 0)
			return false;

		if (n > 0)
			return moveDown(list, key, keyMapper, n);

		return moveUp(list, key, keyMapper, -n);
	}