I have this code:
public static String SelectRandomFromTemplate(String template,int count) {
String[] split = template.split(\"|\");
List
This UnsupportedOperationException comes when you try to perform some operation on collection where its not allowed and in your case, When you call Arrays.asList
it does not return a java.util.ArrayList
. It returns a java.util.Arrays$ArrayList
which is an immutable list. You cannot add to it and you cannot remove from it.