FastByIDMap implements Serializable, Cloneable { public void clear() { numEntries = 0; numSlotsUsed = 0; Arrays.fill(keys, NULL); Arrays.fill(values, null); if (countingAccesses) { recentlyAccessed.clear(); } } FastByIDMap();  FastByIDMap(int size);  FastByIDMap(int size, int maxSize); V get(long key); int size(); boolean isEmpty(); boolean containsKey(long key); boolean containsValue(Object value); V put(long key, V value); V remove(long key); void clear(); LongPrimitiveIterator keySetIterator(); Set<Map.Entry<Long,V>> entrySet(); void rehash(); @Override FastByIDMap<V> clone(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); static final int NO_MAX_SIZE; }
@Test public void testClear() { FastByIDMap<Long> map = new FastByIDMap<Long>(); map.put(500000L, 2L); map.clear(); assertEquals(0, map.size()); assertTrue(map.isEmpty()); assertNull(map.get(500000L)); }