/*
Convenience method for doing the verbose COW remove from the map
10923
private void removeForeignHost(final int hostId) {
        ImmutableCollection<ForeignHost> fhs = m_foreignHosts.get(hostId);
        synchronized (m_mapLock) {
            m_foreignHosts = ImmutableMultimap.<Integer, ForeignHost>builder()
                    .putAll(Multimaps.filterKeys(m_foreignHosts, not(equalTo(hostId))))
                    .build();

            Predicate<Long> hostIdNotEqual = new Predicate<Long>() {
                @Override
                public boolean apply(Long intput) {
                    return CoreUtils.getHostIdFromHSId(intput) != hostId;
                }
            };

            m_fhMapping = ImmutableMap.<Long, ForeignHost>builder()
                    .putAll(Maps.filterKeys(m_fhMapping, hostIdNotEqual))
                    .build();
        }
        assert(Thread.holdsLock(this)); // Make sure m_zombieForeignHosts is protected
        ArrayList<ForeignHost> picoNetworkZombies = m_picoZombieForeignHosts.get(hostId);
        ArrayList<ForeignHost> zookeeperZombies = new ArrayList<>(fhs.size());
        for (ForeignHost fh : fhs) {
            if (picoNetworkZombies != null && picoNetworkZombies.contains(fh)) {
                picoNetworkZombies.remove(fh);
            }
            else {
                zookeeperZombies.add(fh);
            }
            fh.close();
        }
        if (picoNetworkZombies != null && picoNetworkZombies.isEmpty()) {
            m_picoZombieForeignHosts.remove(hostId);
        }
        if (!zookeeperZombies.isEmpty()) {
            m_zkZombieForeignHosts.put(hostId, zookeeperZombies);
        }
    }
1065513
static void detach() {
        map.get().kill();
        try {
          map.get().join();
        } catch (InterruptedException e) {
          Thread.currentThread().interrupt();
        }
        map.remove();
    }
287797
public Object remove(String key) {
        if (key != null) {
            return map.remove(key);
        }
        return null;
    }
89443
public static <L, K> void removeListener (Map<K, ListenerList<L>> map, K key, L listener)
    {
        ListenerList<L> list = map.get(key);
        if (list != null) {
            list.remove(listener);
        }
    }
1227500
function() {
        /**
         * We have to override this method because the event pane destroy
         * deletes the mapObject reference before removing this layer from
         * the map.
         */
        if (this.map) {
            this.setGMapVisibility(false);
            var cache = OpenLayers.Layer.Google.cache[this.map.id];
            if (cache && cache.count <= 1) {
                this.removeGMapElements();
            }            
        }
        OpenLayers.Layer.EventPane.prototype.destroy.apply(this, arguments);
    }
469312
function() {
        //remove all event handlers, delete from entities
        this.each(function() {
            var comp;
            this.trigger("Remove");
            for (var compName in this.__c) {
                comp = components[compName];
                if (comp && "remove" in comp) comp.remove.call(this, true);

                // update map from component to (entityId -> entity)
                delete compEntities[compName][this[0]];
            }
            this._unbindAll();
            delete entities[this[0]];
        });
    }
698469
@SuppressWarnings("unchecked")
  protected boolean removeMapping(Object o) {
    freePendingTables();

    if (!(o instanceof Entry<?, ?>)) {
      return false;
    }

    Entry<K, V> e = (Entry<K, V>) o;

    Object key = e.getKey();
    int hash = key.hashCode();

    hashtable.position(indexFor(spread(hash)));

    for (int i = 0; i < reprobeLimit(); i++) {
      if (!hashtable.hasRemaining()) {
        hashtable.rewind();
      }

      IntBuffer entry = (IntBuffer) hashtable.slice().limit(ENTRY_SIZE);

      if (isTerminating(entry)) {
        return false;
      } else if (isPresent(entry) && keyEquals(key, hash, readLong(entry, ENCODING), entry.get(KEY_HASHCODE))
          && storageEngine.equalsValue(e.getValue(), readLong(entry, ENCODING))) {
        storageEngine.freeMapping(readLong(entry, ENCODING), entry.get(KEY_HASHCODE), true);

        entry.put(STATUS, STATUS_REMOVED);
        slotRemoved(entry);
        shrink();
        return true;
      } else {
        hashtable.position(hashtable.position() + ENTRY_SIZE);
      }
    }

    return false;
  }
1156162
protected void removeBeanFromScratchMap() {
		Map<Object, Object> scratchMap = getBeanScratchMap();
		if (scratchMap == null) {
			return;
		}
		scratchMap.remove(SCRATCHMAP_BEAN_ID_KEY);
		scratchMap.remove(SCRATCHMAP_BEAN_OBJECT_KEY);
	}
403432
public static void removeValue(Map map, Object value) {
	Iterator it = map.entrySet().iterator();
	Map.Entry entry;
	while (it.hasNext()) {
	    entry = (Entry) it.next();
	    if (entry.getValue() == value) it.remove();
	}
    }
1020577
@Override
    public V remove(Object key) {
        if (fast) {
            synchronized (this) {
                Map<K, V> temp = cloneMap(map);
                V result = temp.remove(key);
                map = temp;
                return (result);
            }
        } else {
            synchronized (map) {
                return (map.remove(key));
            }
        }
    }
687010
static <K, E> void removeFromList(Map<K, List<E>> map, K k, E e)
    {
        List<E> list = map.get(k);
        if (list != null)
        {
            list.remove(e);
            if (list.isEmpty())
            {
                map.remove(k);
            }
        }
    }
148498
void cleanUpStaleEntries() {
        for (KeyedRef<K, V> ref = q.poll(); ref != null; ref = q.poll()) {
            map.remove(ref.getKey(), ref); // CONCURRENT remove() operation
        }
    }
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;
    }
313018
public void removeAllElements()
  {

    if (null == m_map)
      return;

    for (int i = 0; i < m_firstFree; i++)
    {
      m_map[i] = DTM.NULL;
    }

    m_firstFree = 0;
  }
817345
void removeFromInodeMap(List<INode> inodes) {
    if (inodes != null) {
      for (INode inode : inodes) {
        if (inode != null) {
          inodeMap.remove(inode);
        }
      }
    }
  }
477772
function(map) {
        map.events.unregister("changelayer", this, this.handleChangeLayer);
        this.resetRoots();
        OpenLayers.Layer.Vector.prototype.removeMap.apply(this, arguments);
    }
301528
private boolean removeMapping(Object key, Object value) {
        Object k = maskNull(key);
        Object[] tab = table;
        int len = tab.length;
        int i = hash(k, len);

        while (true) {
            Object item = tab[i];
            if (item == k) {
                if (tab[i + 1] != value)
                    return false;
                modCount++;
                size--;
                tab[i] = null;
                tab[i + 1] = null;
                closeDeletion(i);
                return true;
            }
            if (item == null)
                return false;
            i = nextKeyIndex(i, len);
        }
    }