class PackageGraph implements ProgressCheck {

    @Override
    public void identifyEmbeddedPackage(final PackageId packageId, final PackageId parentId,
                                        final EmbeddedPackageInstallable slingInstallable) {
        final PackageId self = Optional.ofNullable(slingInstallable).map(EmbeddedPackageInstallable::getEmbeddedId).orElse(packageId);
        final PackageId parent = Optional.ofNullable(slingInstallable).map(EmbeddedPackageInstallable::getParentId).orElse(parentId);
        if (self != null && parent != null) {
            identified.add(self);
            getOrCreateNode(self).setParent(getOrCreateNode(parent));
        }
    }

}