Suppose I need TreeSet with elements sorted with some domain logic. By this logic it doesn\'t matter order of some elements that doesn\'t equal so compare metho
Beware: even for two Foos f1,f2 with f1 != f2 you could get f1.hashCode() == f2.hashCode()! That means you won't get a stable sorting with your compare Method.