@Test(expected = RuntimeException.class)
public void addPackageDescrDifferentPkgUUID() {

    String pkgUUID = generateUUID();
    PackageDescr first = new PackageDescr(NAMESPACE);
    first.setPreferredPkgUUID(pkgUUID);
    assertTrue(first.getPreferredPkgUUID().isPresent());
    compositePackageDescr.addPackageDescr(new ByteArrayResource(), first);
    assertTrue(compositePackageDescr.getPreferredPkgUUID().isPresent());
    assertEquals(pkgUUID, compositePackageDescr.getPreferredPkgUUID().get());
    pkgUUID = generateUUID();
    PackageDescr second = new PackageDescr(NAMESPACE);
    second.setPreferredPkgUUID(pkgUUID);
    assertTrue(second.getPreferredPkgUUID().isPresent());
    assertNotEquals(first.getPreferredPkgUUID().get(), second.getPreferredPkgUUID().get());
    compositePackageDescr.addPackageDescr(new ByteArrayResource(), second);
}