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:
If you feel EqualsVerifier is too strict, you can make it more lenient:
And EqualsVerifier even gives you 100% coverage on
Don’t forget to add it to your build!
or, for a ‘fat’ jar with no transitive dependencies: