@Test
public void testHashCode()
{

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