/** * * Removes the given value from the collection of values associated with * the given key. If removing the value results in the key having no * more entries associated with it, the key itself is removed. * * @param map * @param key * @param value * */ private void removeItem(MultiMap map, Object key, Object value) { Collection all = (Collection)map.get(key); all.remove(value); if (all.isEmpty()) map.remove(key); }