a2Req.getDirectives().put(Namespace.REQUIREMENT_CARDINALITY_DIRECTIVE, Namespace.CARDINALITY_MULTIPLE);
a2.addRequirement(a2Req);
ResourceImpl b1 = new ResourceImpl("B");
b1.addCapability(new BundleCapability(b1, "B"));
Capability b1_p2 = new PackageCapability(b1, "p2");
b1_p2.getDirectives().put(Namespace.CAPABILITY_USES_DIRECTIVE, "p1");
b1.addCapability(b1_p2);
b1.addRequirement(new PackageRequirement(b1, "p1"));
ResourceImpl b2 = new ResourceImpl("B");
b2.addCapability(new BundleCapability(b2, "B"));
Capability b2_p2 = new PackageCapability(b2, "p2");
b2_p2.getDirectives().put(Namespace.CAPABILITY_USES_DIRECTIVE, "p1");
b2.addCapability(b2_p2);
b2.addRequirement(new PackageRequirement(b2, "p1"));
ResourceImpl c1 = new ResourceImpl("C");
c1.addCapability(new BundleCapability(c1, "C"));
Capability c1_p1 = new PackageCapability(c1, "p1");
ResourceImpl c2 = new ResourceImpl("C");
c2.addCapability(new BundleCapability(c2, "C"));
Capability c2_p1 = new PackageCapability(c2, "p1");
ResourceImpl d1 = new ResourceImpl("D");
GenericCapability d1_generic = new GenericCapability(d1, "generic");
d1_generic.addDirective(Namespace.CAPABILITY_USES_DIRECTIVE, "p1,p2");
d1.addCapability(d1_generic);