Here you can find the source of shuffle(Collection
public static <T> List<T> shuffle(Collection<T> items, Random random)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Random; public class Main { public static <T> List<T> shuffle(Collection<T> items, Random random) { List<T> result = new ArrayList<T>(items); Collections.shuffle(result, random); return result; }/*ww w . ja va 2s . com*/ }