To use, create a new EqualsTester and add equality groups where each group contains objects that are supposed to be equal to each other, and objects of different groups are expected to be unequal. For example:
new EqualsTester() .addEqualityGroup("hello", "h" + "ello") .addEqualityGroup("world", "wor" + "ld") .addEqualityGroup(2, 1 + 1) .testEquals();This tests:
When a test fails, the error message labels the objects involved in the failed comparison as follows:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|