private void assertNoSubDirectories(File dir) {
    assertDirectoryIsValid(dir);

    File[] subDirs = dir.listFiles(File::isDirectory);
    assertNotNull(subDirs);
    assertEquals(0, subDirs.length);
  }
Asserts that the given directory does not contain any sub-directories.
@param dir the directory to check.
ambry-file-transfer/src/test/java/com/github/ambry/filetransfer/handler/StoreFileCopyHandlerIntegTest.java