code: @Override
    public void removeRange(int fromIndex, int toIndex) {
      assert (fromIndex >= 0 && fromIndex <= size()) 
        : "Index " + fromIndex + " out of bounds [" + 0 + ", " + size() + ").";
      assert (toIndex >= 0 && toIndex <= size()) 
        : "Index " + toIndex + " out of bounds [" + 0 + ", " + size() + "].";
      assert fromIndex <= toIndex 
        : "fromIndex must be <= toIndex: " + fromIndex + ", " + toIndex;
  
      System.arraycopy(buffer, toIndex, buffer, fromIndex, elementsCount - toIndex);
      final int count = toIndex - fromIndex;
      elementsCount -= count;
      Arrays.fill(buffer, elementsCount, elementsCount + count, Intrinsics.empty());
    }
docs: {@inheritDoc}