Rewrite hashCode() methods and tested equals and hashCode methods