@Test
public void getIndex() {

    when(requestPathInfo.getExtension()).thenReturn(SiteMapConstants.XML);
    setSelectors((String[])null);
    assertEquals(0, model.getIndex(request));
    setSelectorsString("sitemap");
    assertEquals(0, model.getIndex(request));
    setSelectorsString("sitemap.0");
    assertEquals(0, model.getIndex(request));
    setSelectorsString("sitemap.1");
    assertEquals(1, model.getIndex(request));
    setSelectorsString("sitemap.x");
    assertEquals(-1, model.getIndex(request));
    setSelectorsString("sitemap..x");
    assertEquals(0, model.getIndex(request));
}