Say an ArrayList is of size n.
In my case, I often need to remove from 1 to n elements with different indexes from an ArrayList.
By using visualvm profiler,
ArrayList is not really a good data structure to do this operation.
I would suggest you to use the HashMap for this purpose, you can keep the key, value pair with the key as the indexes.