dcsimg

Why can't I add a collection to itself?

John Zukowski

This will cause a stack overflow exception to be generated on calls to methods like toString() and hashCode(), which recursively call the method on the elements of the collection.