code: protected void bulkInsert() {
          if (insertionBufferSize == 0) {
              return;
          }
          int right = size + insertionBufferSize - 2;
          int left = Math.max(size, right / 2);
          while (insertionBufferSize > 0) {
              --insertionBufferSize;
              array[size] = insertionBuffer[insertionBufferSize];
              insertionBuffer[insertionBufferSize] = null;
              reverse.clear(size);
              ++size;
          }
          while (right > left + 1) {
              left = left / 2;
              right = right / 2;
              for (int j = left; j <= right; j++) {
                  fixdown(j);
              }
          }
          if (left != 0) {
              int i = dancestor(left);
              fixdown(i);
              fixup(i);
          }
          if (right != 0) {
              int i = dancestor(right);
              fixdown(i);
              fixup(i);
          }
          insertionBufferMinPos = 0;
      }
docs: Bulk insert from insertion buffer into the weak heap.