class PackageNameMatcher {

    public static PackageNameMatcher compile(final List<String> specs) {
        if (specs == null) {
            throw new IllegalArgumentException("null package name specifications");
        }

        final List<Pattern> list = new ArrayList<>();

        for (String part : specs) {
            list.add(buildPattern(part));
        }

        return new PackageNameMatcher(list);
    }

    private  PackageNameMatcher(List<Pattern> patterns);

}