EqualsVerifier

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:

@Test
public void equalsContract() {
    EqualsVerifier.forClass(Foo.class).verify();
}

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

Sounds great, how do I use it?

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

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.