docs: public static RoaringBitmap flip(RoaringBitmap bm, final long rangeStart, final long rangeEnd) {
      rangeSanityCheck(rangeStart, rangeEnd);
      if (rangeStart >= rangeEnd) {
        return bm.clone();
      }
      RoaringBitmap answer = new RoaringBitmap();
      final int hbStart = Util.toIntUnsigned(Util.highbits(rangeStart));
      final int lbStart = Util.toIntUnsigned(Util.lowbits(rangeStart));
      final int hbLast = Util.toIntUnsigned(Util.highbits(rangeEnd - 1));
      final int lbLast = Util.toIntUnsigned(Util.lowbits(rangeEnd - 1));
  
      // copy the containers before the active area
      answer.highLowContainer.appendCopiesUntil(bm.highLowContainer, (short) hbStart);
  
      for (int hb = hbStart; hb <= hbLast; ++hb) {
        final int containerStart = (hb == hbStart) ? lbStart : 0;
        final int containerLast = (hb == hbLast) ? lbLast : Util.maxLowBitAsInteger();
  
        final int i = bm.highLowContainer.getIndex((short) hb);
        final int j = answer.highLowContainer.getIndex((short) hb);
        assert j < 0;
  
        if (i >= 0) {
          Container c =
              bm.highLowContainer.getContainerAtIndex(i).not(containerStart, containerLast + 1);
          if (!c.isEmpty()) {
            answer.highLowContainer.insertNewKeyValueAt(-j - 1, (short) hb, c);
          }
  
        } else { // *think* the range of ones must never be
          // empty.
          answer.highLowContainer.insertNewKeyValueAt(-j - 1, (short) hb,
              Container.rangeOfOnes(containerStart, containerLast + 1));
        }
      }
      // copy the containers after the active area.
      answer.highLowContainer.appendCopiesAfter(bm.highLowContainer, (short) hbLast);
      return answer;
    }