code: public void flip(final long rangeStart, final long  rangeEnd) {
      rangeSanityCheck(rangeStart, rangeEnd);
      if (rangeStart >= rangeEnd) {
        return; // empty range
      }
  
      final int hbStart = BufferUtil.toIntUnsigned(BufferUtil.highbits(rangeStart));
      final int lbStart = BufferUtil.toIntUnsigned(BufferUtil.lowbits(rangeStart));
      final int hbLast = BufferUtil.toIntUnsigned(BufferUtil.highbits(rangeEnd - 1));
      final int lbLast = BufferUtil.toIntUnsigned(BufferUtil.lowbits(rangeEnd - 1));
  
      for (int hb = hbStart; hb <= hbLast; ++hb) {
        // first container may contain partial range
        final int containerStart = (hb == hbStart) ? lbStart : 0;
        // last container may contain partial range
        final int containerLast = (hb == hbLast) ? lbLast : BufferUtil.maxLowBitAsInteger();
        final int i = highLowContainer.getIndex((short) hb);
  
        if (i >= 0) {
          final MappeableContainer c =
              highLowContainer.getContainerAtIndex(i).inot(containerStart, containerLast + 1);
          if (!c.isEmpty()) {
            getMappeableRoaringArray().setContainerAtIndex(i, c);
          } else {
            getMappeableRoaringArray().removeAtIndex(i);
          }
        } else {
          getMappeableRoaringArray().insertNewKeyValueAt(-i - 1, (short) hb,
              MappeableContainer.rangeOfOnes(containerStart, containerLast + 1));
        }
      }
    }
docs: Modifies the current bitmap by complementing the bits in the given range, from rangeStart
  (inclusive) rangeEnd (exclusive).
  
  @param rangeStart inclusive beginning of range
  @param rangeEnd exclusive ending of range