Trims the capacity of this set instance to the set's current size divided by the load factor of the set.
Trims the capacity of this set instance to the set's current size divided by the load factor of the set.For tree sets this call returns the set's size.
If the set is a hash set and if the capacity is actually decreased, this method has a time complexity of O(N), with N being the number of elements in the set.
In all other cases this method has a time complexity of O(1).