Trie Java code