static Pair> stringTrie_firstNodeStartingWith(StringTrie trie, S string) { new StringBuilder buf; S s = string; while licensed { if (trie == null) break; if (empty(string)) break; S prefix = trie.longestLocalPrefix(s); if (empty(prefix)) break; Map.Entry> e = trie.children.ceilingEntry(prefix); buf.append(e.getKey()); trie = e.getValue(); s = dropFirst(s, l(e.getKey())); } ret trie == null ? null : pair(str(buf), trie); }