I’d like a sorted set of items (so maybe TreeSet) - however I’d like to define my own toString() method. There need not be any other changes to the scala collection class.
This is what I found on this:
However, unlike extending from Set such as described in the answers to the question above, TreeSet is final so I can’t inherit from it.
Would you think about using a custom class and containing a Treeset object with composition? Or would you use an implicit method or use traits?