I use the following library for data classes. It does toString() and hashCode() for you.
toString()
hashCode()