public static PackageSet parsePackages(String input) {
        List<PackageInfo> packages = new ArrayList<>();

        Matcher matcher = PACKAGE_PATTERN.matcher(input);
        while (matcher.find()) {
            String packageName = matcher.group(1).trim();
            String version = matcher.group(2).trim();
            String dependencyPackage = matcher.group(3);
            String dependencyClause = matcher.group(4);

            List<String> clauses = new ArrayList<>();
            if (dependencyPackage != null && dependencyClause != null) {
                clauses.add(dependencyPackage.trim() + ";" + dependencyClause.trim());
            }

            PackageInfo packageInfo = new PackageInfo(packageName, version, clauses);
            packages.add(packageInfo);
        }
        return new PackageSet(packages);
    }
Integration tests for {@link ExportPackages}.

@author gjoranv
jdisc_core/src/test/java/com/yahoo/jdisc/core/ExportPackagesIT.java