Laurent Hinoul

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - John F. Woods

How to unit test equals and hashcode

The equals and hashcode methodes are simple to test with JQNO.

Maven dependency:

Jar:

http://mvnrepository.com/artifact/nl.jqno.equalsverifier/equalsverifier/1.1.3

Code:

(ModelClassToTest = your class name you want to test)

Leave a Reply