java pass arraylist by value

Java
void foo(final ArrayList list) {

    ArrayList listCopy = new ArrayList(list);
    // Rest of the code

}
Source

Also in Java: