Get the least and greatest element in this TreeSet'>

E ceiling(E e)
Returns the least element in this set greater than or equal to the given element, or null if there is no such element.
E floor(E e)
Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.
E higher(E e)
Returns the least element in this set strictly greater than the given element, or null if there is no such element.
E lower(E e)
Returns the greatest element in this set strictly less than the given element, or null if there is no such element.
Home 
  Java Book 
    Collection  

TreeSet:
  1. TreeSet class
  2. Create TreeSet objects
  3. Add elements to a TreeSet
  4. Get the least and greatest element in this TreeSet'>
  5. The first and last element in this TreeSet
  6. Get the head set and tail set
  7. Remove element from TreeSet
  8. Get the size of this TreeSet
  9. Get a subset from this TreeSet