Minimal Trie implementation in Java