Have you ever written an equals method, along with five screens of unit tests to test it? Or worse: not bothered to test it at all, because “the IDE generates it anyway”?

EqualsVerifier helps you. Testing equals can be as simple as:

public void equalsContract() {

If you feel EqualsVerifier is too strict, you can make it more lenient:

public void simpleEqualsContract() {

And EqualsVerifier even gives you 100% coverage on equals and hashCode methods.

Sounds great, how do I use it?

Add it to your build like this (please adjust for your build system of choice):

  • If you want to get started quickly, read the getting started page.
  • If you want to learn more, read the manual, or watch the video:

If you’re interested, there’s more to read:

Fork me on GitHub!

The source for this project is hosted on GitHub.

Pull Requests are welcome! But please also open an issue or send a message to the Google Group so we can discuss it.