SortedMapWritable extends AbstractMapWritable implements SortedMap<K, Writable> { @Override public void putAll(Map<? extends K, ? extends Writable> t) { for (Map.Entry<? extends K, ? extends Writable> e: t.entrySet()) { put(e.getKey(), e.getValue()); } } SortedMapWritable();  SortedMapWritable(SortedMapWritable<K> other); @Override Comparator<? super K> comparator(); @Override K firstKey(); @Override SortedMap<K, Writable> headMap(K toKey); @Override K lastKey(); @Override SortedMap<K, Writable> subMap(K fromKey, K toKey); @Override SortedMap<K, Writable> tailMap(K fromKey); @Override void clear(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override Set<Map.Entry<K, Writable>> entrySet(); @Override Writable get(Object key); @Override boolean isEmpty(); @Override Set<K> keySet(); @Override Writable put(K key, Writable value); @Override void putAll(Map<? extends K, ? extends Writable> t); @Override Writable remove(Object key); @Override int size(); @Override Collection<Writable> values(); @SuppressWarnings("unchecked") @Override void readFields(DataInput in); @Override void write(DataOutput out); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test(timeout = 10000) public void testPutAll() { SortedMapWritable<Text> map1 = new SortedMapWritable<Text>(); SortedMapWritable<Text> map2 = new SortedMapWritable<Text>(); map1.put(new Text("key"), new Text("value")); map2.putAll(map1); assertEquals("map1 entries don't match map2 entries", map1, map2); assertTrue( "map2 doesn't have class information from map1", map2.classToIdMap.containsKey(Text.class) && map2.idToClassMap.containsValue(Text.class)); }