TypedMap implements Map<String, Object> { public void putAll(Map<? extends String, ? extends Object> arg0) { inner.putAll(convertToTypedObjects(arg0)); } TypedMap(final RecordType type);  TypedMap(final RecordType type, final Map<? extends String, ? extends Object> map); RecordType getType(); Type getFieldType(final String fieldName); void clear(); boolean containsKey(Object arg0); boolean containsValue(Object arg0); Set<Entry<String, Object>> entrySet(); Object get(Object arg0); boolean isEmpty(); Set<String> keySet(); Object put(String arg0, Object arg1); void putAll(Map<? extends String, ? extends Object> arg0); Object remove(Object arg0); int size(); Collection<Object> values(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testPutAll() throws Exception { Map<String, Object> values = new HashMap<String, Object>(); values.put("intValue", 1); values.put("booleanValue", true); String[] stringArray = new String[] { "a", "b", "c" }; values.put("stringArray", stringArray); TypedMap map = new TypedMap(recordType, values); map.putAll(new HashMap<String, Object>() { private static final long serialVersionUID = -8115611546753861314L; { put("intValue", 2); put("booleanValue", false); } }); assertEquals(3, map.size()); assertEquals(2, map.get("intValue")); assertEquals(false, map.get("booleanValue")); try { map.putAll(new HashMap<String, Object>() { private static final long serialVersionUID = 736865797008997634L; { put("intValue", 3); put("longValue", 5L); } }); fail(); } catch (NoSuchRecordFieldException e) { } try { map.putAll(new HashMap<String, Object>() { private static final long serialVersionUID = 4403233078265485312L; { put("intValue", 6L); } }); fail(); } catch (UnassignableValueException e) { } }