Adding tests for toString and hashCode, and fixed issue where the
methods equals, toString and hashCode could not be invoked