Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Collections; import java.util.List; public class Main { /** * Shift object to the top of list * * @param list list * @param index object index */ public static void shiftItemToFront(List<?> list, int index) { if (index >= 0) { Collections.rotate(list.subList(index, list.size()), -1); } } }