code: @Override
    public void fill(int fromIndex, int toIndex)
    {
      if (fromIndex > toIndex) {
        throw new IndexOutOfBoundsException(
            "fromIndex: " + fromIndex
            + " > toIndex: " + toIndex
        );
      }
      if (fromIndex == toIndex) {
        add(fromIndex);
        return;
      }
  
      // Increase capacity if necessary
      int startWordIndex = wordIndex(fromIndex);
      int endWordIndex = wordIndex(toIndex);
      expandTo(endWordIndex);
  
      final int[] localWords = words;       // faster
  
      boolean modified = false;
      int firstWordMask = ALL_ONES_WORD << fromIndex;
      int lastWordMask = ALL_ONES_WORD >>> -(toIndex + 1);
      if (startWordIndex == endWordIndex) {
        // Case 1: One word
        int before = localWords[startWordIndex];
        localWords[startWordIndex] |= (firstWordMask & lastWordMask);
        modified = localWords[startWordIndex] != before;
      } else {
        // Case 2: Multiple words
        // Handle first word
        int before = localWords[startWordIndex];
        localWords[startWordIndex] |= firstWordMask;
        modified = localWords[startWordIndex] != before;
  
        // Handle intermediate words, if any
        for (int i = startWordIndex + 1; i < endWordIndex; i++) {
          modified = modified || localWords[i] != ALL_ONES_WORD;
          localWords[i] = ALL_ONES_WORD;
        }
  
        // Handle last word
        before = localWords[endWordIndex];
        localWords[endWordIndex] |= lastWordMask;
        modified = modified || localWords[endWordIndex] != before;
      }
      if (modified) {
        size = -1;
      }
    }
docs: {@inheritDoc}