We could make these less verbose by using Guava's Objects.equal and Objects.hashCode utility methods.