Arrays.asList returns a fixed-size
List backed by the array. If you want a normal mutable
java.util.ArrayList you need to do this:
List list = new ArrayList(Arrays.asList(string.split(" , ")));
Or, using Guava:
List list = Lists.newArrayList(Splitter.on(" , ").split(string));
Splitter gives you more flexibility in how you split the string and gives you the ability to, for example, skip empty strings in the results and trim results. It also has less weird behavior than
String.split as well as not requiring you to split by regex (that's just one option).