public Set<String> referencedPackagesMissingFrom(Set<String> definedAndExportedPackages) {
        return Sets.difference(referencedPackages(), definedAndExportedPackages).stream()
                .filter(pkg -> !pkg.startsWith("java."))
                .filter(pkg -> !pkg.equals(com.yahoo.api.annotations.PublicApi.class.getPackageName()))
                .collect(Collectors.toSet());
    }
@Test
    void referenced_packages_missing_from_available_packages_are_detected() {
        PackageTally tally = new PackageTally(Map.of(), Set.of("p1", "java.util", "com.yahoo.api.annotations", "missing"));
        Set<String> missingPackages = tally.referencedPackagesMissingFrom(Set.of("p1"));
        assertEquals(Set.of("missing"), missingPackages);
    }