@Test(enabled = false) public void shouldMapBeanToMap() { Order order = new Order(); order.customer = new Customer(); order.customer.address = new Address(); order.customer.address.city = "Seattle"; order.customer.address.street = "1234 Main Street"; @SuppressWarnings("unchecked") Map<String, Map<String, Map<String, String>>> map = modelMapper.map(order, LinkedHashMap.class); modelMapper.validate(); assertEquals(map.get("customer").get("address").get("city"), order.customer.address.city); assertEquals(map.get("customer").get("address").get("street"), order.customer.address.street); }
@Override public Object get(Map<String, Object> source, String memberName) { return source.get(memberName); }
MapValueReader implements ValueReader<Map<String, Object>> { @Override public Object get(Map<String, Object> source, String memberName) { return source.get(memberName); } }
MapValueReader implements ValueReader<Map<String, Object>> { @Override public Object get(Map<String, Object> source, String memberName) { return source.get(memberName); }  }
MapValueReader implements ValueReader<Map<String, Object>> { @Override public Object get(Map<String, Object> source, String memberName) { return source.get(memberName); }  @Override Object get(Map<String, Object> source, String memberName); @SuppressWarnings("unchecked") @Override Member<Map<String, Object>> getMember(Map<String, Object> source, String memberName); @Override Collection<String> memberNames(Map<String, Object> source); }
MapValueReader implements ValueReader<Map<String, Object>> { @Override public Object get(Map<String, Object> source, String memberName) { return source.get(memberName); }  @Override Object get(Map<String, Object> source, String memberName); @SuppressWarnings("unchecked") @Override Member<Map<String, Object>> getMember(Map<String, Object> source, String memberName); @Override Collection<String> memberNames(Map<String, Object> source);  }