@Test public void singletonSortedSet() { SortedSet<Integer> set = new TreeSet<Integer>(); set.add(1); this.verify(Collections.<Integer>singletonSortedSet(1), set, 0, 1); }
@Test public void singletonSortedMap() { SortedMap<Integer, String> map = new TreeMap<Integer, String>(); map.put(1, ""); this.verify(Collections.<Integer, String>singletonSortedMap(1, ""), map, 0, 1, ""); }
@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(); }
@Override public SortedSet<E> subSet(E fromElement, E toElement) { Comparator<E> comparator = naturalComparator(); return ((comparator.compare(this.element, toElement) < 0) && (comparator.compare(this.element, fromElement) >= 0)) ? this : Collections.<E>emptySortedSet(); }
@Override public SortedMap<K, V> tailMap(K fromKey) { return (naturalComparator().compare(this.entry.getKey(), fromKey) >= 0) ? this : Collections.<K, V>emptySortedMap(); }
@Override public SortedMap<K, V> headMap(K toKey) { return (naturalComparator().compare(this.entry.getKey(), toKey) < 0) ? this : Collections.<K, V>emptySortedMap(); }
@Override public SortedSet<E> tailSet(E fromElement) { return (naturalComparator().compare(this.element, fromElement) >= 0) ? this : Collections.<E>emptySortedSet(); }
@Override public SortedSet<E> headSet(E toElement) { return (naturalComparator().compare(this.element, toElement) < 0) ? this : Collections.<E>emptySortedSet(); }
@Test public void emptySortedSet() { this.verify(Collections.<Integer>emptySortedSet(), new TreeSet<Integer>(), 0, 1); }
@Test public void emptySortedMap() { this.verify( Collections.<Integer, String>emptySortedMap(), new TreeMap<Integer, String>(), 0, 1, ""); }