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 testFollowSymbolicDirectoryLink() throws IOException {
        final File directory = TempDirUtils.newFolder(temporaryFolder, "a");
        final File file = new File(directory, "a.jar");
        assertThat(file.createNewFile()).isTrue();

        final File otherDirectory = TempDirUtils.newFolder(temporaryFolder);
        java.nio.file.Path linkPath = Paths.get(otherDirectory.getPath(), "a.lnk");
        Files.createSymbolicLink(linkPath, directory.toPath());

        Collection<java.nio.file.Path> paths =
                FileUtils.listFilesInDirectory(linkPath, FileUtils::isJarFile);

        assertThat(paths).containsExactlyInAnyOrder(linkPath.resolve(file.getName()));
    }