I did this:
Set<String> mySet = new TreeSet<String>();
String list = ("word,another,word2"); // actually this is much bigger
String[] wordArr = list.split(",");
mySet.addAll(wordArr);
This gives error:
The method addAll(Collection<? extends String>) in the type Set<String> is
not applicable for the arguments (String[])
I think my intentions are clear.
Side ques: is there a better way to achieve my desired set? I know already there are no repeated value in my list.