Is there any other option for me to modify an unmodifiable list apart from manual traversal and putting content into new array?
Some developers choose to build APIs this way rather than cloning ..
Many collections accepts another Collection
as a constructor argument. You can do something like:
List<T> mutable = new ArrayList<>(immutable);
And then just deal with mutable
collection.