### Question:
HugeHashMap extends AbstractMap<K, V> implements HugeMap<K, V> { @Override public V remove(Object key) { long hash = hasher.hash(key); int segment = hasher.getSegment(hash); int segmentHash = hasher.segmentHash(hash); segments[segment].remove(segmentHash, (K) key); return null; } HugeHashMap();  HugeHashMap(HugeConfig config, Class<K> kClass, Class<V> vClass); @Override V put(K key, V value); @Override V get(Object key); @Override V get(K key, V value); @Override V remove(Object key); @Override boolean containsKey(Object key); @NotNull @Override Set<Entry<K, V>> entrySet(); @Override V putIfAbsent(@NotNull K key, V value); @Override boolean remove(@NotNull Object key, Object value); @Override boolean replace(@NotNull K key, @NotNull V oldValue, @NotNull V newValue); @Override V replace(@NotNull K key, @NotNull V value); @Override boolean isEmpty(); @Override int size(); @Override long offHeapUsed(); @Override void clear();  }### Answer:
@Test public void clearMapViaKeyIteratorRemoves() { int noOfElements = 16 * 1024; HugeHashMap<Integer, String> map = getViewTestMap(noOfElements); int sum = 0; for (Iterator it = map.keySet().iterator(); it.hasNext(); ) { it.next(); it.remove(); ++sum; } assertEquals(noOfElements, sum); }
@Test public void clearMapViaValueIteratorRemoves() { int noOfElements = 16 * 1024; HugeHashMap<Integer, String> map = getViewTestMap(noOfElements); int sum = 0; for (Iterator it = map.values().iterator(); it.hasNext(); ) { it.next(); it.remove(); ++sum; } assertEquals(noOfElements, sum); }