Here you can find the source of shuffleIntArray(int[] array)
static int[] shuffleIntArray(int[] array)
//package com.java2s; import java.util.Random; public class Main { static int[] shuffleIntArray(int[] array) { int[] copy = array.clone(); Random rnd = new Random(); for (int i = copy.length - 1; i > 0; i--) { int index = rnd.nextInt(i + 1); // Simple swap int a = copy[index]; copy[index] = copy[i];//from w w w . j a v a 2s . com copy[i] = a; } return copy; } }