@VisibleForTesting
  long recordOffsetInFileUnchecked(int recordId) {
    //recordId is 1-based, convert to 0-based recordNo:
    int recordNo = recordId - 1;

    if (recordNo < recordsOnHeaderPage) {
      return FileHeader.HEADER_SIZE + recordNo * (long)RecordLayout.RECORD_SIZE_IN_BYTES;
    }

    //as-if there were no header:
    int fullPages = recordNo / recordsPerPage;
    int recordsOnLastPage = recordNo % recordsPerPage;

    //header on the first page "pushes out" few records:
    int recordsExcessBecauseOfHeader = recordsPerPage - recordsOnHeaderPage;

    //so the last page could turn into +1 page:
    int recordsReallyOnLastPage = recordsOnLastPage + recordsExcessBecauseOfHeader;
    return (long)(fullPages + recordsReallyOnLastPage / recordsPerPage) * pageSize
           + (long)(recordsReallyOnLastPage % recordsPerPage) * RecordLayout.RECORD_SIZE_IN_BYTES;
  }
@VisibleForTesting
  long recordOffsetInFileUnchecked(int recordId)