ODocument jaimeDoc = new ODocument("PersonTest");
jaimeDoc.field("name", "jaime");
jaimeDoc.save();
ODocument tyrionDoc = new ODocument("PersonTest");
tyrionDoc.fromJSON("{\"@type\":\"d\",\"name\":\"tyrion\",\"emergency_contact\":[{\"relationship\":\"brother\",\"contact\":"
+ jaimeDoc.toJSON() + "}]}");
tyrionDoc.save();
List<Map<String, OIdentifiable>> res = tyrionDoc.field("emergency_contact");
Map<String, OIdentifiable> doc = res.get(0);
Assert.assertTrue(doc.get("contact").getIdentity().isValid());