Here you can find the source of randomPermutations(int[] tab, Random r)
public static int[] randomPermutations(int[] tab, Random r)
//package com.java2s; import java.util.*; public class Main { public static int[] randomPermutations(int[] tab, Random r) { int l = tab.length; for (int i = 0; i < l; i++) { int j = r.nextInt(l); int tmp = tab[i]; tab[i] = tab[j];// ww w . ja v a 2 s. c o m tab[j] = tmp; } return tab; } public static int[] randomPermutations(int[] tab, long seed) { return randomPermutations(tab, new Random(seed)); } public static <E> E[] randomPermutations(E[] tab, Random r) { int l = tab.length; for (int i = 0; i < l; i++) { int j = r.nextInt(l); E tmp = tab[i]; tab[i] = tab[j]; tab[j] = tmp; } return tab; } public static <E> E[] randomPermutations(E[] tab, long seed) { return randomPermutations(tab, new Random(seed)); } }