原因:Arrays.asList(arr) 转换的 List 并不能进行 add 和 remove 操作
解决:List list = new ArrayList<>(Arrays.asList(split));
源码
Arrays.asList(arr) 返回 Aarrays A r r a y L i s t , A a r r a y s ArrayList , Aarrays ArrayList,AarraysArrayList 继承 AbstractList
ArrayList 继承 AbstractList
AbstractList 中的 add 方法和 remove 方法都直接抛出 UnsupportedOperationException
ArrayList 重写 add 方法和 remove 方法