class Trie extends AbstractMap<String, V> {

    <C extends Collection<T>, T> C prefixed(String prefix, Function<Entry<String, V>, T> mapper, C collection) {
        var entry = root;
        for (var character : prefix.toCharArray()) {
            entry = entry.child(character);
            if (entry == null) {
                return collection;
            }
        }
        
        map(entry, mapper, collection);
        return collection;
    }

    public  Trie();

}