public void addPackageDescr(Resource resource, PackageDescr packageDescr) {
        if (!getNamespace().equals(packageDescr.getNamespace())) {
            throw new RuntimeException("Composing PackageDescr (" + packageDescr.getName()
                + ") in different namespaces (namespace=" + getNamespace()
                + " packageDescr=" + packageDescr.getNamespace() + ")" );
        }
        internalAdd(resource, packageDescr);
    }
@Test(expected = RuntimeException.class)
    public void addPackageDescrDifferentPkgUUID() {
        String pkgUUID = generateUUID();
        PackageDescr first = new PackageDescr(NAMESPACE);
        first.setPreferredPkgUUID(pkgUUID);
        assertThat(first.getPreferredPkgUUID().isPresent()).isTrue();
        compositePackageDescr.addPackageDescr(new ByteArrayResource(), first);
        assertThat(compositePackageDescr.getPreferredPkgUUID().isPresent()).isTrue();
        assertThat(compositePackageDescr.getPreferredPkgUUID().get()).isEqualTo(pkgUUID);
        pkgUUID = generateUUID();
        PackageDescr second = new PackageDescr(NAMESPACE);
        second.setPreferredPkgUUID(pkgUUID);
        assertThat(second.getPreferredPkgUUID().isPresent()).isTrue();
        assertThat(second.getPreferredPkgUUID().get()).isNotEqualTo(first.getPreferredPkgUUID().get());
        compositePackageDescr.addPackageDescr(new ByteArrayResource(), second);
    }