Made deepCopy() a class member and made test for it.