Passing ArrayList as value only and not reference
Even if you had a way to pass the array list as a copy and not by reference it would have been only a shallow copy. I would do something like: void foo(final ArrayList list) { ArrayList listCopy = new ArrayList(list); // Rest of the code } And just work on the copied list.