public static PackageMetaData analyzePackages(Set<ClassFileMetaData> allClasses) {
        Set<String> definedPackages = new HashSet<>();
        Set<String> referencedPackages = new HashSet<>();
        for (ClassFileMetaData metaData : allClasses) {
            definedPackages.add(packageName(metaData.getName()));
            metaData.getReferencedClasses().forEach(className -> referencedPackages.add(packageName(className)));
        }
        referencedPackages.removeAll(definedPackages);
        return new PackageMetaData(definedPackages, referencedPackages);
    }
Returns a sorted list of the imported packages that exist in the given set of disallowed packages.
bundle-plugin/src/main/java/com/yahoo/container/plugin/classanalysis/Packages.java