Pitfals of Cloneable in Java
How to create a deep copy of ArrayList via clone() ? Find out that there are some interesting default Java behaviors in regards to cloning. Create unclonable object to prevent from cloning something which shouldn't' be cloned by any other.
Compare cloned objects between each other and look at Clonable interface which is not always implemented by lists in Java.
"Some time ago, I described a couple of surprising design choices in the JDK functional interfaces API. Lately, during a lesson, a student of mine proposed to shallow-copy an ArrayList by using th..."