Sortef sets are gonna be a sub interface of set where the type parameter has to be comparable. And Im gonnna add first() and last() methods to the interface, which retrieve the first and last elements of the natural order of the elements of the set. Im also gonna make TreeSet implement Set AND SortedSet. The first one allows it to be declared as a set for simplicity. The second enforces the type parameter to extend comparable.
Sortef sets are gonna be a sub interface of set where the type parameter has to be comparable. And Im gonnna add first() and last() methods to the interface, which retrieve the first and last elements of the natural order of the elements of the set. Im also gonna make TreeSet implement Set AND SortedSet. The first one allows it to be declared as a set for simplicity. The second enforces the type parameter to extend comparable.