Add tests for hashcode and equals

Testing the overridden hashCode() and equals() methods.