public static Collection<java.nio.file.Path> listFilesInDirectory(
            final java.nio.file.Path directory, final Predicate<java.nio.file.Path> fileFilter)
            throws IOException {
        checkNotNull(directory, "directory");
        checkNotNull(fileFilter, "fileFilter");

        if (!Files.exists(directory)) {
            throw new IllegalArgumentException(
                    String.format("The directory %s dose not exist.", directory));
        }
        if (!Files.isDirectory(directory)) {
            throw new IllegalArgumentException(
                    String.format("The %s is not a directory.", directory));
        }

        final FilterFileVisitor filterFileVisitor = new FilterFileVisitor(fileFilter);

        Files.walkFileTree(
                directory,
                EnumSet.of(FileVisitOption.FOLLOW_LINKS),
                Integer.MAX_VALUE,
                filterFileVisitor);

        return filterFileVisitor.getFiles();
    }
@Test
    void testListDirFailsIfDirectoryDoesNotExist() {
        final String fileName = "_does_not_exists_file";
        assertThatThrownBy(
                        () ->
                                FileUtils.listFilesInDirectory(
                                        temporaryFolder.getRoot().resolve(fileName),
                                        FileUtils::isJarFile))
                .isInstanceOf(IllegalArgumentException.class);
    }