ObjectContentManager ocm = this.getObjectContentManager();
//---------------------------------------------------------------------------------------------------------
// Insert
//---------------------------------------------------------------------------------------------------------
AnotherDescendant anotherDescendant = new AnotherDescendant();
anotherDescendant.setAnotherDescendantField("anotherDescendantValue");
anotherDescendant.setAncestorField("ancestorValue");
anotherDescendant.setPath("/test");
ocm.insert(anotherDescendant);
ocm.save();
//---------------------------------------------------------------------------------------------------------
// Retrieve
//---------------------------------------------------------------------------------------------------------
Interface result = (Interface) ocm.getObject("/test");
assertNotNull("Object is null", result);
anotherDescendant = (AnotherDescendant) result;
assertEquals("Descendant path is invalid", anotherDescendant.getPath(), "/test");
assertEquals("Descendant ancestorField is invalid", anotherDescendant.getAncestorField(), "ancestorValue");
assertEquals("Descendant descendantField is invalid", anotherDescendant .getAnotherDescendantField(), "anotherDescendantValue");
} catch (Exception e) {
e.printStackTrace();
fail();
}