@Test
  public void testValidDataSizeAfterPuts() throws StoreException {
    assumeTrue(!bucketingEnabled);
    BlobStoreStats blobStoreStats = setupBlobStoreStats(0, 0);
    // advance time to the next second for deletes/expiration to take effect
    advanceTimeToNextSecond();
    long timeInMsBeforePuts = state.time.milliseconds();
    long totalLogSegmentValidSizeBeforePuts =
        verifyAndGetLogSegmentValidSize(blobStoreStats, new TimeRange(timeInMsBeforePuts, 0L));
    long totalContainerValidSizeBeforePuts =
        verifyContainerStorageStatsAndGetTotalValidSize(blobStoreStats, timeInMsBeforePuts);

    // 3 puts
    state.addPutEntries(3, PUT_RECORD_SIZE, Utils.Infinite_Time);

    long timeInMsAfterPuts = state.time.milliseconds();
    long totalLogSegmentValidSizeAfterPuts =
        verifyAndGetLogSegmentValidSize(blobStoreStats, new TimeRange(timeInMsAfterPuts, 0L));
    long totalContainerValidSizeAfterPuts =
        verifyContainerStorageStatsAndGetTotalValidSize(blobStoreStats, timeInMsAfterPuts);
    long expectedIncrement = 3 * PUT_RECORD_SIZE;
    assertEquals("Put entries are not properly counted for log segment valid size", totalLogSegmentValidSizeAfterPuts,
        totalLogSegmentValidSizeBeforePuts + expectedIncrement);
    assertEquals("Put entries are not properly counted for container valid size", totalContainerValidSizeAfterPuts,
        totalContainerValidSizeBeforePuts + expectedIncrement);
    blobStoreStats.close();
  }
Tests to verify the correctness of reported stats after new puts via the following steps:
1. Verify reported stats and record the total valid size prior to adding the new puts.
2. Add new puts.
3. Verify reported stats and record the total valid size after new puts are added.
4. Verify the delta of total valid size prior to adding the new puts and after matches with the expected delta.
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/BlobStoreStatsTest.java