// check the created object
final Map addressFields = addressValue.getFieldValuesAsMap();
assertEquals(2, addressFields.size());
final ImmutableStringValue emailValue =
(ImmutableStringValue) addressFields.get("email");
assertEquals("foo-bar@example.com", emailValue.getValueAsString());
final ImmutableStructureValue postalValue =
(ImmutableStructureValue) addressFields.get("postal");
final Map postalFields = postalValue.getFieldValuesAsMap();
assertEquals(4, postalFields.size());
final ImmutableNumberValue houseNumberValue =
(ImmutableNumberValue) postalFields.get("house-number");
assertEquals(new Integer(42), houseNumberValue.getValueAsNumber());
final ImmutableStringValue streetNameValue =
(ImmutableStringValue) postalFields.get("street-name");
assertEquals("Foo", streetNameValue.getValueAsString());
final ImmutableStringValue streetTypeValue =
(ImmutableStringValue) postalFields.get("street-type");
assertEquals("Road", streetTypeValue.getValueAsString());
final ImmutableStringValue cityValue =
(ImmutableStringValue) postalFields.get("city");
assertEquals("Bar", cityValue.getValueAsString());
final Object otherStructure = doRoundTrip(structure);
assertEquals(structure, otherStructure);
}