code: public TrieNode traverse(String str) {
      if (str.isEmpty()) {
        return this;
      }
      return getChild(str.charAt(0)).map(n -> n.traverse(str.substring(1))).orElse(this);
    }
docs: Traverse trie node.
  
  @param str the str
  @return the trie node