Code example for NavigableSet

Methods: tailSet

  @Override public SortedSet<E> tailSet(E fromElement) {
    return tailSet(fromElement, true);
  @Override public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
    return delegate.tailSet(checkValid(fromElement), inclusive);
  @Override public Object[] toArray() {
    return delegate.toArray();
  @Override public <T> T[] toArray(T[] a) {
    return delegate.toArray(a);
  private <T> T checkValid(T t) {
    // a ClassCastException is what's supposed to happen! 
    E e = (E) t;
Connect your IDE to all the code out there  Get Codota for Java