Open
Description
See Effective Java by Josua Bloch, item 11.
This will fail in Junit5, and probably in Junit 4 and TestNG too:
assertEquals(new Complex(1, 0), new Complex(1, 0));
because the expected (left) and actual (right) values have different hash codes.
IntelliJ can make a working hashCode method for you in seconds.
Metadata
Assignees
Labels
No labels