I repeatedly heard about what is recommended when overriding equals override and hashCode . But so it is recommended that it seems that you will not refuse.
Is there any agreement that if I redefine equals , then hashCode must also be redefined, otherwise the code will not be considered correct? Or is it just a recommendation?