Monthly Archives : June 2012

Home  >>  2012  >>  June

How do you test equals and hashCode?

On June 25, 2012, Posted by , In JUnit, With 8 Comments

Just recently I had to implement equals() and hashCode() for several classes. With the aid of your favourite IDE, generating these methods is a matter of seconds. Well, if there weren’t the missing tests. As I tend to be obsessive when it comes to tests, I also want to have…