public Set<String> filesInDirectory(File dir) throws IOException {

        Set<String> fileList = new HashSet<>();
        Path dirPath = Paths.get(dir.getPath());
        if (!Files.exists(dirPath)) {
            return Collections.emptySet();
        }

        try (DirectoryStream<Path> stream = Files.newDirectoryStream(dirPath)) {
            for (Path path : stream) {
                if (!Files.isDirectory(path)) {
                    fileList.add(path.toString());
                }
            }
        }

        return fileList;
    }
@Test
    public void testFilesInDirectoryBadDirectory() throws IOException {

        Set<String> result = fileUtil.filesInDirectory(new File(FOOBAR));

        assertTrue(result.isEmpty());
    }