static int run(File buildResult, Path root) throws IOException {
        // parse included dependencies from build output
        final Map<String, Set<Dependency>> modulesWithBundledDependencies =
                combineAndFilterFlinkDependencies(
                        ShadeParser.parseShadeOutput(buildResult.toPath()),
                        DependencyParser.parseDependencyCopyOutput(buildResult.toPath()));

        final Set<String> deployedModules = DeployParser.parseDeployOutput(buildResult);

        LOG.info(
                "Extracted "
                        + deployedModules.size()
                        + " modules that were deployed and "
                        + modulesWithBundledDependencies.keySet().size()
                        + " modules which bundle dependencies with a total of "
                        + modulesWithBundledDependencies.values().size()
                        + " dependencies");

        // find modules producing a shaded-jar
        List<Path> noticeFiles = findNoticeFiles(root);
        LOG.info("Found {} NOTICE files to check", noticeFiles.size());

        final Map<String, Optional<NoticeContents>> moduleToNotice =
                noticeFiles.stream()
                        .collect(
                                Collectors.toMap(
                                        NoticeFileChecker::getModuleFromNoticeFile,
                                        noticeFile -> {
                                            try {
                                                return NoticeParser.parseNoticeFile(noticeFile);
                                            } catch (IOException e) {
                                                // some machine issue
                                                throw new RuntimeException(e);
                                            }
                                        }));

        return run(modulesWithBundledDependencies, deployedModules, moduleToNotice);
    }
@Test
    void testRunSkipsNonDeployedModules() throws IOException {
        final String moduleName = "test";
        final Dependency bundledDependency = Dependency.create("a", "b", "c", null);
        final Map<String, Set<Dependency>> bundleDependencies = new HashMap<>();
        bundleDependencies.put(moduleName, Collections.singleton(bundledDependency));
        final Set<String> deployedModules = Collections.emptySet();
        // this would usually be a problem, but since the module is not deployed it's OK!
        final Optional<NoticeContents> emptyNotice =
                Optional.of(new NoticeContents(moduleName, Collections.emptyList()));

        assertThat(
                        NoticeFileChecker.run(
                                bundleDependencies,
                                deployedModules,
                                Collections.singletonMap(moduleName, emptyNotice)))
                .isEqualTo(0);
    }