The statement:
Collections.unmodifiableList(a1);
returns a wrapper over the original collection whose modifier methods throw UnsupportedOperationException
.
The wrapper is read-through, meaning that if you modify a1
, the changes reflect on the wrapped collection a2
.