@Test
public void testEquals()
{

    EntityReference reference1 = new EntityReference("page", EntityType.DOCUMENT,
        new EntityReference("space", EntityType.SPACE,
            new EntityReference("wiki", EntityType.WIKI)));
    Assert.assertEquals(reference1, reference1);
    EntityReference reference2 = new EntityReference("page", EntityType.DOCUMENT,
        new EntityReference("space", EntityType.SPACE,
            new EntityReference("wiki", EntityType.WIKI)));
    Assert.assertEquals(reference1, reference2);
    EntityReference reference3 = new EntityReference("page", EntityType.DOCUMENT,
        new EntityReference("space", EntityType.SPACE,
            new EntityReference("wiki2", EntityType.WIKI)));
    Assert.assertFalse(reference1.equals(reference3));
    EntityReference reference4 = new EntityReference("page", EntityType.DOCUMENT,
        new EntityReference("space2", EntityType.SPACE,
            new EntityReference("wiki", EntityType.WIKI)));
    Assert.assertFalse(reference1.equals(reference4));
    EntityReference reference5 = new EntityReference("page2", EntityType.DOCUMENT,
        new EntityReference("space", EntityType.SPACE,
            new EntityReference("wiki", EntityType.WIKI)));
    Assert.assertFalse(reference1.equals(reference5));
    EntityReference reference6 = new EntityReference("page", EntityType.DOCUMENT, null);
    Assert.assertFalse(reference1.equals(reference6));
    Assert.assertEquals(reference6, new EntityReference("page", EntityType.DOCUMENT, null));
}