MapWritable extends AbstractMapWritable implements Map<Writable, Writable> { @Override public Writable put(Writable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } MapWritable();  MapWritable(MapWritable other); @Override void clear(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override Set<Map.Entry<Writable, Writable>> entrySet(); @Override boolean equals(Object obj); @Override Writable get(Object key); @Override int hashCode(); @Override boolean isEmpty(); @Override Set<Writable> keySet(); @Override Writable put(Writable key, Writable value); @Override void putAll(Map<? extends Writable, ? extends Writable> t); @Override Writable remove(Object key); @Override int size(); @Override Collection<Writable> values(); @Override void write(DataOutput out); @Override void readFields(DataInput in); @Override String toString();  }
@SuppressWarnings("deprecation") @Test public void testForeignClass() { MapWritable inMap = new MapWritable(); inMap.put(new Text("key"), new UTF8("value")); inMap.put(new Text("key2"), new UTF8("value2")); MapWritable outMap = new MapWritable(inMap); MapWritable copyOfCopy = new MapWritable(outMap); assertEquals(1, copyOfCopy.getNewClasses()); }