How do you solve unsupported operation exception?

How can I solve an unsupported operation exception?

The UnsupportedOperationException may be avoided by using a mutable collection that can be changed, such as ArrayList. It should not be tried to modify an unmodifiable collection or data structure.

In the previous example, the unmodifiable List produced by the Arrays.asList() function may be handed to a new ArrayList object, which can be modified: Refer to this blog