Here you can find the source of shuffleArray(List list)
public static void shuffleArray(List list)
//package com.java2s; //License from project: Open Source License import java.util.List; import java.util.Random; public class Main { public static void shuffleArray(List list) { Random rand = new Random(); for (int i = list.size() - 1; i > 0; i--) { int index = rand.nextInt(i + 1); swap(list, index, i);/*w ww. j av a 2s.co m*/ } } public static void swap(List list, int indexA, int indexB) { Object temp = list.get(indexA); list.set(indexA, list.get(indexB)); list.set(indexB, temp); } }