Implementation of a Trie in Java