Add a common testing class for trie.