Here you can find the source of rotate(List
public static void rotate(List<Object> a)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static void rotate(List<Object> a) { if (a.size() > 0) { Object tmp = a.remove(0); a.add(tmp);//from w ww. j av a2 s. c o m } } }