Moves every element of the list to a random new position in the list. @param list the List to shuffle. @throws UnsupportedOperationException when replacing an element in the List is not supported.
(List<?> list)
| 1846 | * when replacing an element in the List is not supported. |
| 1847 | */ |
| 1848 | public static void shuffle(List<?> list) { |
| 1849 | shuffle(list, new Random()); |
| 1850 | } |
| 1851 | |
| 1852 | /** |
| 1853 | * Moves every element of the list to a random new position in the list |