A simple trie implementation in Java