}
@Test
public void createACompositeWithAnInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
// Define the component types
PrimitiveComponentType prov = createAProvider();
prov.start();
PrimitiveComponentType cons = createAConsumer();
ServiceReference[] refs = osgiHelper.getServiceReferences(Factory.class.getName(),
"(component.providedServiceSpecifications=" + Foo.class.getName() + ")");
assertThat(refs.length, is(not(0)));
Factory factory = (Factory) osgiHelper.getRawServiceObject(refs[0]);
System.out.println(factory.getComponentDescription().getDescription());
CompositeComponentType type = new CompositeComponentType()
.setBundleContext(context)
.setComponentTypeName("comp2")
.addSubService(new InstantiatedService().setSpecification(Foo.class.getName()))
.addInstance(new Instance(cons.getFactory().getName()));
ComponentInstance ci = type.createInstance();
System.out.println(ci.getInstanceDescription().getDescription());