ObjectMap extends AbstractMap<String, Object> { @Override public Object get(Object key) { if (key instanceof String) { Field field = definition.getField((String) key); if (field != null) { try { return field.get(getObject()); } catch (IllegalAccessException ex) { throw new IllegalStateException(ex); } } } return extras.get(key); } ObjectMap();  ObjectMap(Object object); Object getObject(); void setObject(Object object); Converter getConverter(); void setConverter(Converter converter); @Override void clear(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override Set<Map.Entry<String, Object>> entrySet(); @Override Object get(Object key); @Override boolean isEmpty(); @Override Set<String> keySet(); @Override Object put(String key, Object value); @Override void putAll(Map<? extends String, ? extends Object> map); @Override Object remove(Object key); @Override int size(); @Override Collection<Object> values();  }
@Test public void get_public() { ObjectMap objmap = new ObjectMap(new ObjGet()); assertEquals("pub field value", objmap.get("field_pub")); }
@Test public void get_private() { ObjectMap objmap = new ObjectMap(new ObjGet()); assertEquals("priv field value", objmap.get("field_priv")); }
@Test public void get_primitive() { ObjectMap objmap = new ObjectMap(new ObjGet()); assertEquals(1000, objmap.get("field_int")); }
@Test public void get_object() { ObjectMap objmap = new ObjectMap(new ObjGet()); assertEquals(2000, objmap.get("field_Integer")); }
@Test public void get_unknown() { ObjectMap objmap = new ObjectMap(new ObjGet()); assertEquals(null, objmap.get("field_unknown")); }
@Test public void get_inherit() { ObjectMap objmap = new ObjectMap(new ObjGet() { public String field_child = "field child value"; }); assertEquals("pub field value", objmap.get("field_pub")); assertEquals("field child value", objmap.get("field_child")); }