@Test
public void testFindPrefixMatches() {

	TreeDispatcher<String> dispatcher = setupDispatcher();
	
	List<String> matches = dispatcher.findPrefixMatches("/one/two/three/four/five/six/seven/eight");
	assertNotNull(matches);
	assertEquals(matches.size(), 3);
	assertEquals(matches.get(0), "/one/two/three/four/five/six");
	assertEquals(matches.get(1), "/one/two/three/four");
	assertEquals(matches.get(2), "/one/two");
	
	matches = dispatcher.findPrefixMatches("//one///two////three/////four////five///six///seven/eight////");
	assertEquals(matches.size(), 3);
	assertEquals(matches.get(0), "/one/two/three/four/five/six");
	assertEquals(matches.get(1), "/one/two/three/four");
	assertEquals(matches.get(2), "/one/two");
	
	matches = dispatcher.findPrefixMatches("//one///two////three//\\//four/five/six/seven/eight");
	assertEquals(matches.size(), 1);
	assertEquals(matches.get(0), "/one/two");
	
	matches = dispatcher.findPrefixMatches("/one/two");
	assertEquals(matches.size(), 1);
	assertEquals(matches.get(0), "/one/two");
	
	matches = dispatcher.findPrefixMatches("/one/three/three");
	assertNotNull(matches);
	assertTrue(matches.isEmpty());
	
	assertTrue(dispatcher.findPrefixMatches("/*").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/.*").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("one").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/one/tw").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/one/twoo").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/one/two*").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/one/two.*").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/on/two").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/onee/two").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/onetwo").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/oneetwo").isEmpty());
	assertTrue(dispatcher.findPrefixMatches("/one\\two").isEmpty());
}