Can have a comparator function to keep the collection sorted.