Here you can find the source of reverseList2(List
public static <T> List<T> reverseList2(List<T> list)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Main { public static <T> List<T> reverseList2(List<T> list) { List<T> revList = new ArrayList<T>(); for (Iterator<T> iterator = list.iterator(); iterator.hasNext();) { T n = iterator.next();// ww w.j a va2 s . com revList.add(0, n); } return revList; } }