docs: public static MutableRoaringBitmap priorityqueue_or(ImmutableRoaringBitmap... bitmaps) {
      if (bitmaps.length == 0) {
        return new MutableRoaringBitmap();
      } else if (bitmaps.length == 1) {
        return bitmaps[0].toMutableRoaringBitmap();
      }
      // we buffer the call to getLongSizeInBytes(), hence the code complexity
      final ImmutableRoaringBitmap[] buffer = Arrays.copyOf(bitmaps, bitmaps.length);
      final int[] sizes = new int[buffer.length];
      final boolean[] istmp = new boolean[buffer.length];
      for (int k = 0; k < sizes.length; ++k) {
        sizes[k] = buffer[k].serializedSizeInBytes();
      }
      PriorityQueue<Integer> pq = new PriorityQueue<>(128, new Comparator<Integer>() {
        @Override
        public int compare(Integer a, Integer b) {
          return sizes[a] - sizes[b];
        }
      });
      for (int k = 0; k < sizes.length; ++k) {
        pq.add(k);
      }
      while (pq.size() > 1) {
        Integer x1 = pq.poll();
        Integer x2 = pq.poll();
        if (istmp[x1] && istmp[x2]) {
          buffer[x1] = MutableRoaringBitmap.lazyorfromlazyinputs((MutableRoaringBitmap) buffer[x1],
              (MutableRoaringBitmap) buffer[x2]);
          sizes[x1] = buffer[x1].serializedSizeInBytes();
          pq.add(x1);
        } else if (istmp[x2]) {
          ((MutableRoaringBitmap) buffer[x2]).lazyor(buffer[x1]);
          sizes[x2] = buffer[x2].serializedSizeInBytes();
          pq.add(x2);
        } else if (istmp[x1]) {
          ((MutableRoaringBitmap) buffer[x1]).lazyor(buffer[x2]);
          sizes[x1] = buffer[x1].serializedSizeInBytes();
          pq.add(x1);
        } else {
          buffer[x1] = ImmutableRoaringBitmap.lazyor(buffer[x1], buffer[x2]);
          sizes[x1] = buffer[x1].serializedSizeInBytes();
          istmp[x1] = true;
          pq.add(x1);
        }
      }
      MutableRoaringBitmap answer = (MutableRoaringBitmap) buffer[pq.poll()];
      answer.repairAfterLazy();
      return answer;
    }