Here's a class ComplexNumber. You need to override its methods equals() and hashCode(). The method equals() should compare two instances of ComplexNumber by the fields re and im. The method hashCode() must be consistent with your implementation of equals().
Implementations of the method hashCode() that return a constant or do not consider a fractional part of re and im, will not be accepted.
Example
ComplexNumber a = new ComplexNumber(1, 1);
ComplexNumber b = new ComplexNumber(1, 1);
// a.equals(b) must return true
// a.hashCode() must be equal to b.hashCode()
Tip: Find a static method in the class java.lang.Double that will help in solving this quiz.
If you can't solve this quiz anyway, you can use a modern IDE (such as IntelliJ Idea) for automatically generating correct equals() and hashCode(). But in this case, you need to understand what is generated and why it works.