### Question:
LocalDocumentReference extends AbstractLocalizedEntityReference { @Override public LocalDocumentReference replaceParent(EntityReference newParent) { if (newParent == getParent()) { return this; } return new LocalDocumentReference(this, newParent); } LocalDocumentReference(String spaceName, String pageName);  LocalDocumentReference(Iterable<String> spaceNames, String pageName);  LocalDocumentReference(String spaceName, String pageName, Locale locale);  LocalDocumentReference(DocumentReference documentReference);  LocalDocumentReference(EntityReference reference);  LocalDocumentReference(EntityReference entityReference, Locale locale);  LocalDocumentReference(String pageName, EntityReference spaceReference);  LocalDocumentReference(EntityReference reference, EntityReference parent); @Override LocalDocumentReference replaceParent(EntityReference newParent); @Override String toString();  }### Answer:
@Test public void testReplaceParent() { LocalDocumentReference reference = new LocalDocumentReference("space", "page").replaceParent(new EntityReference("space2", EntityType.SPACE)); assertEquals(new LocalDocumentReference("space2", "page"), reference); assertSame(reference, reference.replaceParent(reference.getParent())); }