code: public List subList(int fromIndex, int toIndex) {
          if (fromIndex < 0) {
              throw new IndexOutOfBoundsException("fromIndex = " + fromIndex);
          }
          if (toIndex > size()) {
              throw new IndexOutOfBoundsException("toIndex = " + toIndex);
          }
          if (fromIndex > toIndex) {
              throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
          }
          if (fromIndex == toIndex) {
              return new EmptyRange(from);
          }
  
          return new ObjectRange((Comparable) get(fromIndex), (Comparable) get(--toIndex), reverse);
      }
docs: {@inheritDoc}