How to remove everything from an ArrayList in Java but the first element
As I get it, after removal, array keys are rearranged or not? Yes, the item which was on position 2 is on position 1 after you removed the item on position 1.
You can try this:
Object obj = mapOverlays.get(0); // remember first item
mapOverlays.clear(); // clear complete list
mapOverlays.add(obj); // add first item
You could use
mapOverlays.subList(1, mapOverlays.size()).clear();