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:
Use EqualsTester for equality and string conversion tests
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 | ||||
---|---|---|---|---|
| ||||
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(); } |
...