Code example for Map

Methods: clearget

0
        PathTrie<String> trie = new PathTrie<String>();
        trie.insert("/a/{type}", "test1");
        trie.insert("/b/{name}", "test2");
 
        Map<String, String> params = newHashMap();
        assertThat(trie.retrieve("/a/test", params), equalTo("test1"));
        assertThat(params.get("type"), equalTo("test"));
 
        params.clear();
        assertThat(trie.retrieve("/b/testX", params), equalTo("test2"));
        assertThat(params.get("name"), equalTo("testX"));
    } 
 
    @Test 
    public void testSameNameOnDifferentPath() { 
        PathTrie<String> trie = new PathTrie<String>();
        trie.insert("/a/c/{name}", "test1");
        trie.insert("/b/{name}", "test2");
 
        Map<String, String> params = newHashMap();