Here you can find the source of moveUpInListSingleEntry(List
private static <E> boolean moveUpInListSingleEntry(List<E> list, int index)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { private static <E> boolean moveUpInListSingleEntry(List<E> list, int index) { // ignore calls which try to move up first index if (index == 0) { return false; }/*from ww w . jav a2s. c om*/ E element = list.remove(index); list.add(index - 1, element); return true; } }