1public ArrayList<Object> reverse(ArrayList<Object> arrayList) {
2 if(arrayList.size() > 1) {
3 Object value = arrayList.remove(0);
4 reverse(arrayList);
5 arrayList.add(value);
6 }
7 return arrayList;
8}