public void deleteRecordsUpTo(int idInclusively) throws IOException {
    withWriteLock(() -> {
      LocalHistoryRecordsTable table = (LocalHistoryRecordsTable)myRecordsTable;

      int each = table.getFirstRecord();
      if (each == 0) return;

      while (each != 0) {
        boolean stop = each == idInclusively;

        int next = table.getNextRecord(each);
        doDeleteRecord(each);
        each = next;

        if (stop) break;
      }

      if (each == 0) {
        table.setFirstRecord(0);
        table.setLastRecord(0);
      }
      else {
        table.setFirstRecord(each);
        table.setPrevRecord(each, 0);
      }
    });
  }
public void deleteRecordsUpTo(int idInclusively)