code: public List<Integer> 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(getFrom());
          }
  
          return new IntRange(fromIndex + getFrom(), toIndex + getFrom() - 1, isReverse());
      }
docs: {@inheritDoc}