If this is just for putting into TreeSet, can you use HashSet instead? Or is it required to be sorted?