예제 #1
0
    @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();
    }
예제 #2
0
 @Override
 public SortedSet<E> tailSet(E fromElement) {
   return (naturalComparator().compare(this.element, fromElement) >= 0)
       ? this
       : Collections.<E>emptySortedSet();
 }
예제 #3
0
 @Override
 public SortedSet<E> headSet(E toElement) {
   return (naturalComparator().compare(this.element, toElement) < 0)
       ? this
       : Collections.<E>emptySortedSet();
 }
예제 #4
0
 @Test
 public void emptySortedSet() {
   this.verify(Collections.<Integer>emptySortedSet(), new TreeSet<Integer>(), 0, 1);
 }