EntityReference implements Serializable, Cloneable, Comparable<EntityReference> { public EntityReference getChild() { return this.child; } EntityReference(String name, EntityType type);  EntityReference(String name, EntityType type, EntityReference parent); void setName(String name); String getName(); void setParent(EntityReference parent); EntityReference getParent(); void setChild(EntityReference child); EntityReference getChild(); void setType(EntityType type); EntityType getType(); EntityReference getRoot(); EntityReference extractReference(EntityType type); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override EntityReference clone(); int compareTo(EntityReference reference);  }
@Test public void testGetChild() { EntityReference reference = new EntityReference("page", EntityType.DOCUMENT, new EntityReference("space", EntityType.SPACE, new EntityReference("wiki", EntityType.WIKI))); Assert.assertNull(reference.getChild()); Assert.assertEquals(reference, reference.getParent().getChild()); Assert.assertEquals(reference, reference.getParent().getParent().getChild().getChild()); }