### Question:
TreeMap extends AbstractSortedMap<K, V> { @Override public int size() { return (tree.size() - 1) / 2; } TreeMap();  TreeMap(Comparator<K> comp); @Override int size(); @Override V get(K key); @Override V put(K key, V value); @Override V remove(K key); @Override Entry<K, V> firstEntry(); @Override Entry<K, V> lastEntry(); @Override Entry<K, V> ceilingEntry(K key); @Override Entry<K, V> floorEntry(K key); @Override Entry<K, V> lowerEntry(K key); @Override Entry<K, V> higherEntry(K key); @Override Iterable<Entry<K, V>> entrySet(); @Override Iterable<Entry<K, V>> subMap(K fromKey, K toKey); static void main(String[] args);  }### Answer:
@Test void testSize() { TreeMap<Integer, String> map = new TreeMap<>(); assertEquals(0, map.size()); map.put(1, "one"); map.put(2, "two"); assertEquals(2, map.size()); }