DocumentReference extends EntityReference { public void setWikiReference(WikiReference newWikiReference) { EntityReference wikiReference = extractReference(EntityType.WIKI); wikiReference.getChild().setParent(newWikiReference); } DocumentReference(EntityReference reference);  DocumentReference(String wikiName, String spaceName, String pageName);  DocumentReference(String wikiName, List<String> spaceNames, String pageName);  DocumentReference(String pageName, SpaceReference parent); @Override void setParent(EntityReference parent); @Override void setType(EntityType type); WikiReference getWikiReference(); void setWikiReference(WikiReference newWikiReference); SpaceReference getLastSpaceReference(); List<SpaceReference> getSpaceReferences();  }
@Test public void testSetWikiReference() { DocumentReference reference = new DocumentReference("wiki", "space", "page"); reference.setWikiReference(new WikiReference("newwiki")); Assert.assertEquals(new DocumentReference("newwiki", "space", "page"), reference); }