public void validateCppDoc(Document doc) {
        validateCppDocNotMap(doc);
        MapFieldValue<?, ?> map = (MapFieldValue<?, ?>)doc.getFieldValue("mapfield");
        assertEquals(map.get(new StringFieldValue("foo1")), new StringFieldValue("bar1"));
        assertEquals(map.get(new StringFieldValue("foo2")), new StringFieldValue("bar2"));
    }
Test for Document and all its features, including (de)serialization.

@author Thomas Gundersen
@author bratseth
document/src/test/java/com/yahoo/document/DocumentTestCase.java