Java tutorial
//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; } }