Here you can find the source of shuffle(final T[] arr)
public static <T> void shuffle(final T[] arr)
//package com.java2s; import java.util.Random; public class Main { public static <T> void shuffle(final T[] arr) { Random rnd = new Random(); for (int i = arr.length - 1; i > 0; i--) { int index = rnd.nextInt(i + 1); T tmp = arr[index];// w w w . j a v a 2 s . c o m arr[index] = arr[i]; arr[i] = tmp; } } }