docs: @Override
    public void close() {
      try {
        super.close();
        if(!emptyPages.isEmpty() && header instanceof TreeIndexHeader) {
          // write the list of empty pages to the end of the file
          ((TreeIndexHeader) header).writeEmptyPages(emptyPages, file);
        }
        ((TreeIndexHeader) header).setLargestPageID(nextPageID);
        header.writeHeader(file);
        file.close();
      }
      catch(IOException e) {
        throw new RuntimeException(e);
      }
    }