Example #1
0
    @Override
    public SortedMap<K, V> subMap(K fromKey, K toKey) {
      Comparator<K> comparator = naturalComparator();

      return ((comparator.compare(this.entry.getKey(), toKey) < 0)
              && (comparator.compare(this.entry.getKey(), fromKey) >= 0))
          ? this
          : Collections.<K, V>emptySortedMap();
    }
Example #2
0
 @Override
 public SortedMap<K, V> tailMap(K fromKey) {
   return (naturalComparator().compare(this.entry.getKey(), fromKey) >= 0)
       ? this
       : Collections.<K, V>emptySortedMap();
 }
Example #3
0
 @Override
 public SortedMap<K, V> headMap(K toKey) {
   return (naturalComparator().compare(this.entry.getKey(), toKey) < 0)
       ? this
       : Collections.<K, V>emptySortedMap();
 }
Example #4
0
 @Test
 public void emptySortedMap() {
   this.verify(
       Collections.<Integer, String>emptySortedMap(), new TreeMap<Integer, String>(), 0, 1, "");
 }