Implemented equals and hashCode.