I want to shuffle an array in java but not to change the original list, only shuffle the temporary list.
I wrote something like this.
ArrayList<TristateCheckBox> tempList = buttons;
Collections.shuffle(tempList);
But this not shuffles only tempList also changes the buttons list.
You need to take a copy of the List, not just a copy of the reference to the list.