code: private void processSplitPage(List<BTreePage> splitResult, PageModificationContext context) {
          PageWrapper originalPage = context.getPageWrapper();
          for (int i = 0; i < splitResult.size(); i++) {
              val page = splitResult.get(i);
              ByteArraySegment newPageKey;
              long newOffset;
              long minOffset;
              PageWrapper processedPage;
              if (i == 0) {
                  // The original page will be replaced by the first split. Nothing changes about its pointer key.
                  originalPage.setPage(page);
                  newPageKey = originalPage.getPageKey();
                  context.getPageCollection().complete(originalPage);
                  processedPage = originalPage;
              } else {
                  // Insert the new pages and assign them new virtual offsets. Each page will use its first
                  // Key as a Page Key.
                  newPageKey = page.getKeyAt(0);
                  processedPage = PageWrapper.wrapNew(page, originalPage.getParent(), new PagePointer(newPageKey, PagePointer.NO_OFFSET, page.getLength()));
                  context.getPageCollection().insert(processedPage);
                  context.getPageCollection().complete(processedPage);
              }
  
              // Fetch new offset, and update minimum offsets.
              newOffset = processedPage.getOffset();
              minOffset = calculateMinOffset(processedPage);
              processedPage.setMinOffset(minOffset);
  
              // Record changes.
              context.updatePagePointer(new PagePointer(newPageKey, newOffset, page.getLength(), minOffset));
          }
      }
docs: Processes a Page Split result. The first split page will replace the existing page, while the remaining pages
  will need to be inserted as children into the parent.
  
  @param splitResult The result of the original BTreePage's splitIfNecessary() call.
  @param context     Processing context.