clone object in hashCode() function so the original object is not changed when calling hashCode
provided test for the hasCode() function