@Override
  public int createNewRecord() throws IOException {
    markDirty();
    ensureFreeRecordsScanned();

    int reusedRecord = reserveFreeRecord();
    if (reusedRecord == -1) {
      int result = getRecordsCount() + 1;
      doCleanRecord(result);
      if (getRecordsCount() != result) {
        LOG.error("Failed to correctly allocate new record in: " + storage);
      }
      return result;
    }
    else {
      assert isSizeOfRemovedRecord(getSize(reusedRecord));
      setSize(reusedRecord, 0);
      setCapacity(reusedRecord, 0);
      return reusedRecord;
    }
  }
@Override
  public int createNewRecord()