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