Here you can find the source of shuffle(List
private static <T> List<T> shuffle(List<T> list)
//package com.java2s; /**// ww w. j a v a 2s.com * Copyright (c) 2010, 2011 Darmstadt University of Technology. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Sebastian Proksch - initial API and implementation */ import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { private static <T> List<T> shuffle(List<T> list) { List<T> copy = new ArrayList<T>(list); Collections.shuffle(copy); return copy; } }