@Test
public void addPackageDescrSamePkgUUID() {

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