Comparison Method Violates Its General Contract in Java
IllegalArgumentException: Comparison method violates its general contract! comes from TimSort, not your code. Here is why it fires, and how to fix the comparator.
IllegalArgumentException: Comparison method violates its general contract! comes from TimSort, not your code. Here is why it fires, and how to fix the comparator.