private void writeDataToMeetRequiredSegmentCountForAutoCloseLogSegmentTest(long countRequired) throws StoreException {
    long capacityLimit = countRequired * state.log.getSegmentCapacity();
    int blobsPut = 0;
    while (state.index.getLogUsedCapacity() + PUT_RECORD_SIZE <= capacityLimit) {
      long expiresAtMs = Utils.Infinite_Time;
      state.addPutEntries(1, PUT_RECORD_SIZE, expiresAtMs);
      blobsPut++;
    }
    logger.info("The number of blobs put in the log: {}.", blobsPut);
  }
Write data so that the log contains {@code countRequired} number of log segments. If a non {@code null} for auto close log segment test.
@param countRequired the number of log segments required.
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java