Implement hash and isEqual: methods.