MixedTypeMap implements ReadOnlyMixedTypeMap<K> { public MixedTypeMap<K> putAll(MixedTypeMap<K> otherMap) { map.putAll(otherMap.map); return otherMap; } MixedTypeMap(Map<Key<K, ?>, Object> map);  MixedTypeMap(); void put(K id, Class<V1> clazz, V2 instance); void put(K id, TypeToken<V1> clazz, V2 instance); void put(Key<K, V1> key, V2 instance); @Override V get(K id, Class<V> clazz); @Override V get(K id, TypeToken<V> type); @Override V get(Key<K, V> key); MixedTypeMap<K> putAll(MixedTypeMap<K> otherMap); @Override int size(); void clear();  }
@Test(groups = "fast") public void testPutAll() throws Exception { stringMap1.put("key1", String.class, "value1"); stringMap1.put("key2", String.class, "value2"); stringMap1.put("key3", String.class, "value3"); stringMap2.put("key4", String.class, "value4"); stringMap2.putAll(stringMap1); Assert.assertEquals(stringMap2.get("key1", String.class), "value1"); Assert.assertEquals(stringMap2.get("key2", String.class), "value2"); Assert.assertEquals(stringMap2.get("key3", String.class), "value3"); Assert.assertEquals(stringMap2.get("key4", String.class), "value4"); Assert.assertEquals(stringMap2.size(), stringMap1.size() + 1, "stringMap2 size"); Assert.assertEquals(stringMap1.size(), 6, "stringMap1 size"); }