@Test
  public void testPersistNoFiles() {
    DiskRegionProperties diskRegionProperties = new DiskRegionProperties();
    diskRegionProperties.setOverflow(false);
    diskRegionProperties.setRolling(false);
    diskRegionProperties.setDiskDirs(diskDirs);
    diskRegionProperties.setPersistBackup(true);
    diskRegionProperties.setRegionName(regionName);

    DiskStoreFactory diskStoreFactory = toDiskStoreFactory(diskRegionProperties);

    createDiskStoreWithSizeInBytes(diskStoreName, diskStoreFactory);

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

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

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

    region.destroyRegion();

    int fileCount = 0;
    for (File diskDir : diskDirs) {
      File[] files = diskDir.listFiles();
      fileCount += files.length;
    }

    // since the diskStore has not been closed we expect four files: .lk and .if and a crf and a drf
    assertThat(fileCount).isEqualTo(4);

    cache.close();

    // we now should only have zero since the disk store had no regions remaining in it.
    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