ComponentInstance c = cons.createInstance();
CompositeComponentType type = new CompositeComponentType()
.setBundleContext(context)
.setComponentTypeName("compExport")
.addSubService(new InstantiatedService().setSpecification(Foo.class.getName()))
.addService(new ExportedService().setSpecification(Foo.class.getName()));
ComponentInstance ci = type.createInstance();
assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));