code: public SortedMap subMap(Object startKey, Object endKey) {
          if (comparator == null) {
              if (((Comparable) startKey).compareTo(endKey) <= 0)
                  return makeSubMap(startKey, endKey);
          } else {
              if (comparator.compare(startKey, endKey) <= 0)
                  return makeSubMap(startKey, endKey);
          }
          throw new IllegalArgumentException();
      }
docs: Answers a SortedMap of the specified portion of this TreeMap which
  contains keys greater or equal to the start key but less than the end
  key. The returned SortedMap is backed by this TreeMap so changes to one
  are reflected by the other.
  
  @param startKey the start key
  @param endKey the end key
  
  @return a submap where the keys are greater or equal to
  <code>startKey</code> and less than <code>endKey</code>
  
  @exception ClassCastException
  when the start or end key cannot be compared with the keys
  in this TreeMap
  @exception NullPointerException
  when the start or end key is null and the comparator
  cannot handle null