Did you know that the Arrays.asList() method returns a fixed size list?

I guess this is the problem when you do not read the `javadoc` in detail of the methods you use.  Following is quoted from the javadoc of the Java SDK.

Returns a fixed-size list backed by the specified array. 
(Changes to the returned list "write through" to the array.)

If you try to add or remove elements from the resulting list, you will get an `UnsupportedOperationException`.

Leave a comment