LinkedSortedSet implements SortedSet<T> { public SortedSet<T> subSet(T fromElement, T toElement) { throw new UnsupportedOperationException("Mockito-Collections injected SortedSet does not support this method"); }  int size(); boolean isEmpty(); boolean contains(Object o); Iterator<T> iterator(); Object[] toArray(); E[] toArray(E[] a); boolean add(T e); boolean remove(Object o); boolean containsAll(Collection<?> c); boolean addAll(Collection<? extends T> c); boolean retainAll(Collection<?> c); boolean removeAll(Collection<?> c); void clear(); @Override int hashCode(); @Override boolean equals(Object obj); Comparator<? super T> comparator(); SortedSet<T> subSet(T fromElement, T toElement); SortedSet<T> headSet(T toElement); SortedSet<T> tailSet(T fromElement); T first(); T last();  }
@Test public void shouldSubSet() { LinkedSortedSet<Object> set = new LinkedSortedSet<Object>(); try { set.subSet("From", "To"); fail(); } catch (UnsupportedOperationException e) { assertEquals("Mockito-Collections injected SortedSet does not support this method", e.getMessage()); } }