TrieSet extends AbstractSet<String> { public Set<String> startsWith(String prefix) { return trie.prefixedKeys(prefix); } TrieSet(); Set<String> startsWith(String prefix); @Override boolean add(String string); @Override boolean contains(Object object); @Override boolean remove(Object object); @Override Iterator<String> iterator(); @Override int size();  }
@Test void startsWith() { var prefixed = set.startsWith("appl"); assertEquals(2, prefixed.size()); assertTrue(prefixed.contains("apple")); assertTrue(prefixed.contains("application")); }