}
@Test
public void testPropertyToClassLevelMap() throws Exception {
mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
MapTestObject mto = newInstance(MapTestObject.class);
PropertyToMap ptm = newInstance(PropertyToMap.class);
Map<String, String> map = newInstance(HashMap.class);
map.put("reverseClassLevelMapString", "reverseClassLevelMapStringValue");
mto.setPropertyToMapMapReverse(map);
ptm.setStringProperty("stringPropertyValue");
ptm.addStringProperty2("stringProperty2Value");
ptm.setStringProperty3("stringProperty3Value");
ptm.setStringProperty4("stringProperty4Value");
ptm.setStringProperty5("stringProperty5Value");
mto.setPropertyToMap(ptm);
PropertyToMap ptm2 = newInstance(PropertyToMap.class);
ptm2.setStringProperty("stringPropertyValue");
mto.setPropertyToMapToNullMap(ptm2);
MapTestObjectPrime mtop = mapper.map(mto, MapTestObjectPrime.class);
assertTrue(mtop.getPropertyToMapMap().containsKey("stringProperty"));
assertTrue(mtop.getPropertyToMapMap().containsKey("myStringProperty"));
assertTrue(mtop.getPropertyToMapMap().containsKey("stringProperty3"));
assertTrue(mtop.getPropertyToMapMap().containsKey("stringProperty4"));
assertTrue(mtop.getPropertyToMapMap().containsKey("stringProperty5"));
assertTrue(mtop.getPropertyToMapMap().containsKey("nullStringProperty"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringPropertyValue"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringProperty2Value"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringProperty3Value"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringProperty4Value"));
assertTrue(mtop.getPropertyToMapMap().containsValue("stringProperty5Value"));
assertFalse(mtop.getPropertyToMapMap().containsValue("nullStringProperty"));
assertFalse(mtop.getPropertyToMapMap().containsKey("excludeMe"));
assertEquals("reverseClassLevelMapStringValue", mtop.getPropertyToMapReverse().getReverseClassLevelMapString());
assertTrue(mtop.getNullPropertyToMapMap().containsKey("stringProperty"));
assertEquals("stringPropertyValue", mtop.getNullPropertyToMapMap().get("stringProperty"));
// Map Back
MapTestObject mto2 = mapper.map(mtop, MapTestObject.class);
assertEquals("stringPropertyValue", mto2.getPropertyToMap().getStringProperty());
assertEquals("stringProperty2Value", mto2.getPropertyToMap().getStringProperty2());
assertEquals("stringProperty3Value", mto2.getPropertyToMap().getStringProperty3());
assertEquals("stringProperty4Value", mto2.getPropertyToMap().getStringProperty4());
assertEquals("stringProperty5Value", mto2.getPropertyToMap().getStringProperty5());
assertTrue(mto2.getPropertyToMapMapReverse().containsKey("reverseClassLevelMapString"));
assertEquals("reverseClassLevelMapStringValue", mto2.getPropertyToMapMapReverse().get("reverseClassLevelMapString"));
}