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