SafeIterableMap implements Iterable<Map.Entry<K, V>> { public int size() { return mSize; }  V putIfAbsent(@NonNull K key, @NonNull V v); V remove(@NonNull K key); int size(); @NonNull @Override Iterator<Map.Entry<K, V>> iterator(); Iterator<Map.Entry<K, V>> descendingIterator(); IteratorWithAdditions iteratorWithAdditions(); Map.Entry<K, V> eldest(); Map.Entry<K, V> newest(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testSize() { SafeIterableMap<Integer, Boolean> map = mapOf(1, 2, 3, 4); assertThat(map.size(), is(4)); map.putIfAbsent(5, true); map.putIfAbsent(6, true); assertThat(map.size(), is(6)); map.remove(5); map.remove(5); assertThat(map.size(), is(5)); map.remove(1); map.remove(2); map.remove(4); map.remove(3); map.remove(6); assertThat(map.size(), is(0)); map.putIfAbsent(4, true); assertThat(map.size(), is(1)); assertThat(mapOf().size(), is(0)); }