Here you can find the source of shuffle(T[] data)
public static <T> void shuffle(T[] data)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { private static final Random RandomInstance = new Random(); public static <T> void shuffle(T[] data) { int n = data.length; int n1 = n - 0x01; T tmp;/* www. j a v a 2 s . c om*/ for (int i = 0x00; i < n1; i++) { tmp = data[i]; int j = nextInt(n1 - i) + i; data[i] = data[j]; data[j] = tmp; } } public static int nextInt() { return RandomInstance.nextInt(); } public static int nextInt(int n) { return RandomInstance.nextInt(n); } }