@Test public void testReplaceParent() { PageObjectPropertyReference reference = new PageObjectPropertyReference("prop", new PageObjectReference("object", new PageReference("wiki", "space", "page"))) .replaceParent(new PageObjectReference("object2", new PageReference("wiki2", "space2", "page2"))); assertEquals(new PageObjectPropertyReference("prop", new PageObjectReference("object2", new PageReference("wiki2", "space2", "page2"))), reference); assertSame(reference, reference.replaceParent(reference.getParent())); }
@Override public PageObjectPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent) { if (newParent == oldParent) { return this; } return new PageObjectPropertyReference(this, oldParent, newParent); }
PageObjectPropertyReference extends EntityReference { @Override public PageObjectPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent) { if (newParent == oldParent) { return this; } return new PageObjectPropertyReference(this, oldParent, newParent); } }
PageObjectPropertyReference extends EntityReference { @Override public PageObjectPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent) { if (newParent == oldParent) { return this; } return new PageObjectPropertyReference(this, oldParent, newParent); } PageObjectPropertyReference(EntityReference reference); protected  PageObjectPropertyReference(EntityReference reference, EntityReference oldReference,
        EntityReference newReference);  PageObjectPropertyReference(String propertyName, PageObjectReference objectReference);  PageObjectPropertyReference(EntityReference reference, EntityReference parent); }
PageObjectPropertyReference extends EntityReference { @Override public PageObjectPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent) { if (newParent == oldParent) { return this; } return new PageObjectPropertyReference(this, oldParent, newParent); } PageObjectPropertyReference(EntityReference reference); protected  PageObjectPropertyReference(EntityReference reference, EntityReference oldReference,
        EntityReference newReference);  PageObjectPropertyReference(String propertyName, PageObjectReference objectReference);  PageObjectPropertyReference(EntityReference reference, EntityReference parent); @Override PageObjectPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent); @Override PageObjectPropertyReference replaceParent(EntityReference newParent); }
PageObjectPropertyReference extends EntityReference { @Override public PageObjectPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent) { if (newParent == oldParent) { return this; } return new PageObjectPropertyReference(this, oldParent, newParent); } PageObjectPropertyReference(EntityReference reference); protected  PageObjectPropertyReference(EntityReference reference, EntityReference oldReference,
        EntityReference newReference);  PageObjectPropertyReference(String propertyName, PageObjectReference objectReference);  PageObjectPropertyReference(EntityReference reference, EntityReference parent); @Override PageObjectPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent); @Override PageObjectPropertyReference replaceParent(EntityReference newParent);  }