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
You have a Foo class wich is comparable but want to use a different sorting in a TreeSet structure. Then your idea is the correct way to do it. Use that constructor to "overrule" the natural sorting of Foo.