private void writeDataToMeetRequiredSegmentCount(long countRequired, List<Long> expiryTimes) throws StoreException {
    long capacityLimit = countRequired * state.log.getSegmentCapacity();
    int blobsPut = 0;
    int expiredBlobsCount = 0;
    while (state.index.getLogUsedCapacity() + PUT_RECORD_SIZE <= capacityLimit) {
      long expiresAtMs = Utils.Infinite_Time;
      if (expiryTimes != null && blobsPut % 4 == 0) {
        expiresAtMs = expiryTimes.get(expiredBlobsCount % expiryTimes.size());
        expiredBlobsCount++;
      }
      state.addPutEntries(1, PUT_RECORD_SIZE, expiresAtMs);
      blobsPut++;
    }
  }
Writes data so that the log contains {@code countRequired} number of log segments. If a non {@code null}
{@code expiryTimes} is passed, a fraction of the blobs written will contain those expiry times in round robin order
@param countRequired the number of log segments required.
@param expiryTimes the expiry times desired. A fraction of the blobs written will contain those expiry times in
                   round robin order
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java