Here you can find the source of reverseList(List
public static <T> List<T> reverseList(List<T> list)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> reverseList(List<T> list) { List<T> theReturn = new ArrayList<T>(); int size = list.size(); for (int i = size - 1; i >= 0; i--) { T item = list.get(i);// w w w. j a v a 2 s. c om if (item != null) { theReturn.add(item); } } return theReturn; } }