|
public boolean equals(Complex other){ |
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.
java-google-speech-api/src/main/java/com/goxr3plus/speech/util/Complex.java
Line 116 in 1863c92
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.