Code example for TreeSet

0
 * @since 2.3 
 */ 
public class StringsCompleter 
    implements Completer 
{ 
    private final SortedSet<String> strings = new TreeSet<String>();
 
    public StringsCompleter() { 
        // empty 
    } 
 
    public StringsCompleter(final Collection<String> strings) {
        assert strings != null;
        getStrings().addAll(strings);
    } 
 
    public StringsCompleter(final String... strings) {
        this(Arrays.asList(strings));
    }