code: public Word<I> toWord(int fromIndex, int toIndex) {
          if (fromIndex < 0 || toIndex > length) {
              throw new IndexOutOfBoundsException();
          }
          int len = toIndex - fromIndex;
  
          lock = true;
          return new SharedWord<>(array, fromIndex, len);
      }
docs: Creates a word from the given range of the contents of the internal storage. Note that the storage management
  mechanisms of this class guarantee that the returned word will not change regardless of what further operations
  are invoked on this {@link WordBuilder}.
  
  @param fromIndex
  the starting index, inclusive
  @param toIndex
  the end index, exclusive
  
  @return the word for the specified subrange