The associated keys will be removed if null or empty values are returned by the specified <code>function</code>.

@param function
183047
public <X extends Exception> void replaceAll(Try.BiFunction<? super K, ? super V, ? extends V, X> function) throws X {
        List<K> keyToRemove = null;
        V newVal = null;

        for (Map.Entry<K, V> entry : valueMap.entrySet()) {
            newVal = function.apply(entry.getKey(), entry.getValue());

            if (N.isNullOrEmpty(newVal)) {
                if (keyToRemove == null) {
                    keyToRemove = new ArrayList<>();
                }

                keyToRemove.add(entry.getKey());
            } else {
                try {
                    entry.setValue(newVal);
                } catch (IllegalStateException ise) {
                    throw new ConcurrentModificationException(ise);
                }
            }
        }

        if (N.notNullOrEmpty(keyToRemove)) {
            for (K key : keyToRemove) {
                valueMap.remove(key);
            }
        }
    }
944795
public void keyReleased(KeyEvent event)
    {
        lastKeyName = EMPTY_KEY_NAME;
        lastCode = NO_KEY_CODE;

        final Integer key = Integer.valueOf(event.getCode());
        keys.remove(key);
        pressed.remove(key);
    }
311067
@Override
  public void clear()
  {
    if (_size > 0) {
      final K []keys = _keys;
      final V []values = _values;
      final int length = values.length;

      for (int i = length - 1; i >= 0; i--) {
        keys[i] = null;
        values[i] = null;
      }

      _size = 0;
    }

    _nullValue = null;
  }
171280
void removeInlinedFunctions() {
    for (Map.Entry<String, FunctionState> entry : fns.entrySet()) {
      String name = entry.getKey();
      FunctionState functionState = entry.getValue();
      if (functionState.canRemove()) {
        Function fn = functionState.getFn();
        checkState(functionState.canInline());
        checkState(fn != null);
        verifyAllReferencesInlined(name, functionState);
        fn.remove();
        NodeUtil.markFunctionsDeleted(fn.getFunctionNode(), compiler);
      }
    }
  }
63950
private V removeFromDataIndexOfKey(int dataIndexOfKey) {
    int dataSize = this.size << 1;
    if (dataIndexOfKey < 0 || dataIndexOfKey >= dataSize) {
      return null;
    }
    V result = valueAtDataIndex(dataIndexOfKey + 1);
    Object[] data = this.data;
    int moved = dataSize - dataIndexOfKey - 2;
    if (moved != 0) {
      System.arraycopy(data, dataIndexOfKey + 2, data, dataIndexOfKey, moved);
    }
    this.size--;
    setData(dataSize - 2, null, null);
    return result;
  }
604128
private boolean validFunction(final String s) {
        FunctionEnum fe = getFunctionEnum(s);
        if (fe != null) return true;
        return false;
    }
181211
static
	public void putFunction(String name, Function function){
		FunctionRegistry.functions.put(Objects.requireNonNull(name), function);
	}
32082
@Pure
	public static <P1, RESULT> Function0<RESULT> curry(final Function1<? super P1, ? extends RESULT> function, final P1 argument) {
		if (function == null)
			throw new NullPointerException("function");
		return new Function0<RESULT>() {
			@Override
			public RESULT apply() {
				return function.apply(argument);
			}
		};
	}
975670
@Override
  public final void clearCachedValues() {
    super.clearCachedValues();

    if (subTypes != null) {
      for (FunctionType subType : subTypes) {
        subType.clearCachedValues();
      }
    }

    if (!isNativeObjectType()) {
      if (hasInstanceType()) {
        getInstanceType().clearCachedValues();
      }

      if (prototypeSlot != null) {
        ((ObjectType) prototypeSlot.getType()).clearCachedValues();
      }
    }
  }
393655
@NonNull
  public static Term function(
      @Nullable String keyspaceName,
      @NonNull String functionName,
      @NonNull Iterable<Term> arguments) {
    return function(
        keyspaceName == null ? null : CqlIdentifier.fromCql(keyspaceName),
        CqlIdentifier.fromCql(functionName),
        arguments);
  }
691737
@NonNull
  public static Drop dropFunction(
      @Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier functionName) {
    return new DefaultDrop(keyspace, functionName, "FUNCTION");
  }
534377
public int forEach(final ToIntFunction<SelectionKey> function)
    {
        int handledFrames = 0;
        final SelectionKey[] keys = this.keys;

        for (int i = size - 1; i >= 0; i--)
        {
            handledFrames += function.applyAsInt(keys[i]);
        }

        size = 0;

        return handledFrames;
    }
1302127
@SuppressWarnings("unchecked")
	public static <T> Function<T, Void> nullFn() {
		return (Function<T, Void>) NULL_FN;
	}
872907
function removeMethod (char, method) {
  if (!hasKeybinding(char, method)) return;
  var fnIndex = bindings[char].methods.indexOf(method);
  window.removeEventListener('keyup', bindings[char].listeners[fnIndex]);
  bindings[char].methods.splice(fnIndex, 1);
  bindings[char].listeners.splice(fnIndex, 1);

  if (!bindings[char].methods.length) {
    delete bindings[char];
  } else if (fnIndex === 0) {
    window.addEventListener('keyup', bindings[char].listeners[0]);
  }
}
1168986
public V remove(Object key) {
        clean();

        ValueRef<K, V> valueRef = mValues.remove(key);
        V value;

        if (valueRef != null && (value = valueRef.get()) != null) {
            valueRef.clear();
            return value;
        }

        return null;
    }
1013685
public void setFunction(FunctionLibFunction function) {
	function.setFunctionLib(this);
	functions.put(function.getName(), function);
    }
516532
public void addArgsFor(String[] variables, DifferentialFunction function) {
        if (function.getOwnName() == null)
            throw new ND4JIllegalStateException("Instance id can not be null. Function not initialized properly");

        //double check if function contains placeholder args
        for (val varName : variables) {
            if (isPlaceHolder(varName)) {
                placeHolderFunctions.add(function.getOwnName());
            }
        }

        //Add function if it doesn't exist
        //TODO could "not existing" be a bug sometimes?
        if(!ops.containsKey(function.getOwnName())){
            ops.put(function.getOwnName(), SameDiffOp.builder().name(function.getOwnName()).op(function).build());
        }

        //Update variable 'inputs to op' accounting for repeated inputs (like y = x+x)
        ops.get(function.getOwnName()).setInputsToOp(Arrays.asList(variables));     //Duplicate variables OK/required here

        for (String variableName : variables) {
            List<String> funcs = this.variables.get(variableName).getInputsForOp();
            if (funcs == null) {
                funcs = new ArrayList<>();
                this.variables.get(variableName).setInputsForOp(funcs);
            }
            if(!funcs.contains(function.getOwnName()))  //Avoid duplicates for function names.
                funcs.add(function.getOwnName());
        }
    }