Here you can find the source of reverseList(List list)
public static List reverseList(List list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static List reverseList(List list) { if (list == null || list.size() == 0) { return list; }/*from w w w .j a va 2 s. c om*/ int count = list.size() - 1; Object obj = null; for (int i = 0; i <= count / 2; i++) { obj = list.get(i); list.set(i, list.get(count - i)); list.set(count - i, obj); } return list; } }