I am trying to instantiate a TreeSet in scala, passing a specific comparator on tuples like this:
var heads: java.util.TreeSet[(T, Int)] = new java.util.TreeSet[(T, Int)](new Comparator[(T,Int)] {
def compare(o1: (T, Int), o2: (T, Int)): Int = Ordering[(T, Int)].compare(o1, o2)
})
However, an implicit ordering on T cannot be found. Should I specify that T <: Comparable[T] in the type hierarchy or is there a simple wayto achieve tuple comparison?