    @Test
    public void testIterator() {

        for (String test : tests) {
            MappingIterator<Character, String> it = trie.getMappingIterator();
            for (char c : test.toCharArray()) {
                if (it.hasChild(c)) {
                    it.move(c);
                } else {
                    break;
                }
            }
            if (it.canExit()) {
                System.out.println(it.getValue());
            } else {
                System.out.println("allow");
            }
        }
    }