TrieTree { public List<String> all() { char[] chars = new char[MAX_CHAR_LENGTH]; List<String> value = depth(this.root, new ArrayList<String>(), chars, 0); return value; } TrieTree(); void insert(String data); List<String> prefixSearch(String key); List<String> all(); List<String> depth(Node node, List<String> list, char[] chars, int index);  }
@Test public void all() throws Exception { TrieTree trieTree = new TrieTree(); trieTree.insert("ABC"); trieTree.insert("abC"); List<String> all = trieTree.all(); String result = ""; for (String s : all) { result += s + ","; System.out.println(s); } Assert.assertTrue("ABC,abC,".equals(result)); }