Equals and hashcode for new classes.