@Test
public void testSpaceReferences()
{

    DocumentReference reference1 = new DocumentReference("wiki", "space", "page");
    List<SpaceReference> spaceRefs = reference1.getSpaceReferences();
    Assert.assertEquals(1, spaceRefs.size());
    Assert.assertEquals(new SpaceReference("space", new WikiReference("wiki")), spaceRefs.get(0));
    DocumentReference reference2 = new DocumentReference("wiki", Arrays.asList("space1", "space2"), "page");
    List<SpaceReference> spaceRefs2 = reference2.getSpaceReferences();
    Assert.assertEquals(2, spaceRefs2.size());
    Assert.assertEquals(new SpaceReference("space1", new WikiReference("wiki")), spaceRefs2.get(0));
    Assert.assertEquals(new SpaceReference("space2", new SpaceReference("space1", new WikiReference("wiki"))),
        spaceRefs2.get(1));
}