Helper method which retrieves a value for a given key from a map and then deletes the entry for the key.<p>

@param map the map from which to retrieve the value
@param key the key

@return the removed value
438118
protected String getAndRemoveValue(Map<String, String> map, String key) {

        String value = map.get(key);
        if (value != null) {
            map.remove(key);
        }
        return value;
    }
221513
@SuppressWarnings("unchecked")
  public <T> T get(String key) {

    T value = (T) map.get(key);
    return value;
  }
394023
public int removeKey(final K key)
    {
        @DoNotSub final int mask = values.length - 1;
        @DoNotSub int index = Hashing.hash(key, mask);

        int value;
        while (missingValue != (value = values[index]))
        {
            if (key.equals(keys[index]))
            {
                keys[index] = null;
                values[index] = missingValue;
                --size;

                compactChain(index);
                break;
            }

            index = ++index & mask;
        }

        return value;
    }
1332480
public String remove(String group, String key) {
		group = StrUtil.nullToEmpty(group).trim();
		writeLock.lock();
		try {
			final LinkedHashMap<String, String> valueMap = this.get(group);
			if (MapUtil.isNotEmpty(valueMap)) {
				return valueMap.remove(key);
			}
		} finally {
			writeLock.unlock();
		}
		return null;
	}
860182
public final V remove(K key) {
        if (key == null) {
            throw new NullPointerException("key == null");
        }

        V previous;
        synchronized (this) {
            previous = map.remove(key);
            if (previous != null) {
                size -= safeSizeOf(key, previous);
            }
        }

        if (previous != null) {
            entryRemoved(false, key, previous, null);
        }

        return previous;
    }
538745
public final V remove(String key) {
        V oldValue = mMemCache.remove(key);
        removeFromDiskQuietly(key);
        return oldValue;
    }
989990
@Override
    public V get(Object key) {
        if (key == null) {
            throw new NullPointerException();
        }
        
        CachedValue<K, V> entry = map.get(key);
        if (entry == null) {
            return null;
        }
        if (isValueExpired(entry)) {
            if (map.remove(key, entry)) {
                onValueRemove(entry);
                return null;
            }
            return get(key);
        }
        return readValue(entry);
    }
816266
V removeMapping(final Object o) {
        if (!(o instanceof Map.Entry)) {
            throw new IllegalArgumentException();
        }

        @SuppressWarnings("unchecked") final Entry<? extends CharSequence, V> e = (Map.Entry<? extends CharSequence, V>) o;
        final CharSequence key = keyCheck(e.getKey());
        final V value = e.getValue();
        final TrieNode<V> currentNode = findPreviousNode(key);

        if (currentNode == null) {
			/* Node not found for the given key */
            return null;
        }

        final TrieNode<V> node = currentNode.children.get(key.charAt(key
                .length() - 1));

        if (node == null || !node.inUse) {
			/* Node not found for the given key or is not in use */
            return null;
        }

        final V removed = node.value;

        if (removed != value && (removed == null || !removed.equals(value))) {
			/*
			 * Value in the map differs from the value given in the entry so do
			 * nothing and return null.
			 */
            return null;
        }

        node.unset();
        --size;
        ++modCount;

        if (node.children.isEmpty()) {
			/* Since there are no children left, we can compact the trie */
            compact(key);
        }

        return removed;
    }
495973
public static boolean removeEntries(final Map<?, ?> map, final Map<?, ?> entriesToRemove) {
        if (N.isNullOrEmpty(map) || N.isNullOrEmpty(entriesToRemove)) {
            return false;
        }

        final int originalSize = map.size();

        for (Map.Entry<?, ?> entry : entriesToRemove.entrySet()) {
            if (N.equals(map.get(entry.getKey()), entry.getValue())) {
                map.remove(entry.getKey());
            }
        }

        return map.size() < originalSize;
    }
1264470
public void removeKey(String key) {
        if (key != null && !key.isEmpty()) {
            for (int i=0; i<map.size(); i++) {
                KeyValue kv = map.get(i);
                if (key.equals(kv.getKey())) {
                    map.remove(i);
                    return;
                }
            }
        }
    }
599593
@Override
    public V remove(Object key) {
        int index = key == null ? indexOfNull() : indexOf(key, key.hashCode());
        if (index >= 0) {
            return removeAt(index);
        }

        return null;
    }
1326042
public V get (K key)
    {
        V value = null;
        SoftReference<V> ref = _map.get(key);
        if (ref != null) {
            value = ref.get();
            if (value == null) {
                _map.remove(key);
            }
        }
        return value;
    }
1289716
public static <K, V> Map<K, V> copy(final Map<K, V> map) {
		if (map == null) {
			return null;
		}

		TypeEnum keyType = null;
		TypeEnum valueType = null;

		Map<K, V> copy = new HashMap<K, V>();
		for (Map.Entry<K, V> entry : map.entrySet()) {
			K key = entry.getKey();
			V value = entry.getValue();

			K keyCopy = null;
			if (key != null) {
				if (keyType == null) {
					keyType = TypeEnum.dataTypeOf(key.getClass());
				}
				keyCopy = copy(key, keyType);
			}

			V valueCopy = null;
			if (value != null) {
				if (valueType == null) {
					valueType = TypeEnum.dataTypeOf(value.getClass());
				}
				valueCopy = copy(value, valueType);
			}

			copy.put(keyCopy, valueCopy);
		}

		return copy;
	}
272050
static String getValue(Map<String, String> map, String... keys) {
        if (CommonUtils.isEmpty(map)) {
            return null;
        }
        for (String key : keys) {
            String val = map.get(key);
            if (val != null) {
                return val;
            }
        }
        return null;
    }
25377
public static <K, V, E extends Exception> boolean removeIf(final Map<K, V> map, final Try.Predicate<? super Map.Entry<K, V>, E> filter) throws E {
        List<K> keysToRemove = null;

        for (Map.Entry<K, V> entry : map.entrySet()) {
            if (filter.test(entry)) {
                if (keysToRemove == null) {
                    keysToRemove = new ArrayList<>(7);
                }

                keysToRemove.add(entry.getKey());
            }
        }

        if (N.notNullOrEmpty(keysToRemove)) {
            for (K key : keysToRemove) {
                map.remove(key);
            }

            return true;
        }

        return false;
    }
882526
public Object remove(Object key) {
        mCacheMap.remove(key);
        return mBackingMap.remove(key);
    }
424478
public Object getValue(Map<String, Object> map, String name) {
        String cleanName = htmlCleaner.cleanupValue(name);
        return getValueImpl(map, cleanName, true);
    }