### Question:
LocalPageReference extends AbstractLocalizedEntityReference { @Override public LocalPageReference replaceParent(EntityReference newParent) { if (newParent == getParent()) { return this; } return new LocalPageReference(this, newParent); } LocalPageReference(String pageName, String... pageNames);  LocalPageReference(List<String> pageNames);  LocalPageReference(String pageName, Locale locale);  LocalPageReference(EntityReference reference);  LocalPageReference(EntityReference entityReference, Locale locale);  LocalPageReference(String pageName, EntityReference pageReference);  LocalPageReference(PageReference pageReference);  LocalPageReference(EntityReference reference, EntityReference parent); @Override LocalPageReference replaceParent(EntityReference newParent); @Override String toString();  }### Answer:
@Test public void testReplaceParent() { LocalPageReference reference = new LocalPageReference("space", "page").replaceParent(new EntityReference("space2", EntityType.PAGE)); assertEquals(new LocalPageReference("space2", "page"), reference); assertSame(reference, reference.replaceParent(reference.getParent())); }