public static java.nio.file.Path getTargetPathIfContainsSymbolicPath(java.nio.file.Path path)
            throws IOException {
        java.nio.file.Path targetPath = path;
        java.nio.file.Path suffixPath = Paths.get("");
        while (path != null && path.getFileName() != null) {
            if (Files.isSymbolicLink(path)) {
                java.nio.file.Path linkedPath = path.toRealPath();
                targetPath = Paths.get(linkedPath.toString(), suffixPath.toString());
                break;
            }
            suffixPath = Paths.get(path.getFileName().toString(), suffixPath.toString());
            path = path.getParent();
        }
        return targetPath;
    }
@Test
    void testGetTargetPathContainsSymbolicPath() throws IOException {
        File linkedDir = TempDirUtils.newFolder(temporaryFolder, "linked");
        java.nio.file.Path symlink = Paths.get(temporaryFolder.toString(), "symlink");
        java.nio.file.Path dirInLinked =
                TempDirUtils.newFolder(linkedDir.toPath(), "one", "two").toPath().toRealPath();
        Files.createSymbolicLink(symlink, linkedDir.toPath());

        java.nio.file.Path targetPath =
                FileUtils.getTargetPathIfContainsSymbolicPath(
                        symlink.resolve("one").resolve("two"));
        assertThat(targetPath).isEqualTo(dirInLinked);
    }