I have this kind of map:
Map<String, List<String>> map = new HashMap<>();
And I'm trying to edit one of my list's values. This is how I tried to achieve that:
map.get(key).toArray()[index] = newString;
I convert my list into an array and assign new String. But this line of code does nothing. Is there any solution to it? I think I can just create a new list which will have a different value, but I hope there is a simpler way to achieve that.
Thank you in advance