Fix PMD violations in hashCode and equals.

Also use the Guava methods for equals and hashCode. Add a test.
Merge pull request #7 from hgschmie/master

Fix PMD violations in hashCode and equals.