Here you can find the source of shuffle(int[] array, Random rnd)
public static int[] shuffle(int[] array, Random rnd)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { public static int[] shuffle(int[] array, Random rnd) { for (int i = array.length - 1; i > 0; i--) { int pos = rnd.nextInt(i + 1); int t = array[pos]; array[pos] = array[i];/*from w ww . j a v a 2 s.c om*/ array[i] = t; } return array; } }