@Test
  public void testOverflowOnlyNoFiles() {
    DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
    diskRegionProperties.setTimeInterval(15000);
    diskRegionProperties.setBytesThreshold(100000);
    diskRegionProperties.setOverFlowCapacity(1000);
    diskRegionProperties.setDiskDirs(diskDirs);

    DiskStoreFactory diskStoreFactory = toDiskStoreFactory(diskRegionProperties);

    createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory);

    Region<Integer, Object> region =
        createRegion(regionName, diskStoreName, false, false, false, true, 1_000);

    byte[] value = new byte[1024];
    Arrays.fill(value, (byte) 77);

    for (int i = 0; i < 100; i++) {
      region.put(i, value);
    }

    region.close(); // closes disk file which will flush all buffers

    // verify that there are no files in the disk dir
    int fileCount = 0;
    for (File diskDir : diskDirs) {
      File[] files = diskDir.listFiles();
      fileCount += files.length;
    }

    // since the diskStore has not been closed we expect two files: .lk and .if
    assertThat(fileCount).isEqualTo(2);
    cache.close();

    // we now should only have zero
    fileCount = 0;
    for (File diskDir : diskDirs) {
      File[] files = diskDir.listFiles();
      fileCount += files.length;
    }
    assertThat(fileCount).isEqualTo(0);
  }
DiskRegOverflowOnlyNoFilesTest: Overflow only mode has no files of previous run, during startup
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java