Due to a ransomware attack, the wiki was reverted to a July 2022 version. . We apologize for the lack of a more recent valid backup.
...
If you add a class, consider adding the following basic tests for it first:
Any class that defines equals(), hashCode(), or toString() must test these methods. The Google Guava EqualsTester class provides full coverage for these methods:
Code Block language java title Using EqualsTester final FlowId flowId1 = FlowId.valueOf(1);
final FlowId sameAsFlowId1 = FlowId.valueOf(1);
final FlowId flowId2 = FlowId.valueOf(2);
/**
* Checks the operation of equals(), hashCode() and toString() methods.
*/
@Test
public void testEquals() {
new EqualsTester()
.addEqualityGroup(flowId1, sameAsFlowId1)
.addEqualityGroup(flowId2)
.testEquals();
}
We use the Hamcrest matchers, version 1.3.