Testing autocomplete using a trie