Java provides way to define comparison of object outside scope Object using Comparator.

Now my questions is why java does not allow do same for equals() and hashcode().

Now each collection contains() method can easily use this external equality provider to check objects are equal.

Edit
Report