implement equals() and hashCode() for using with Sets.