private SingletonComponentType createAnOptionalConsumer() {
PrimitiveComponentType type = new SingletonComponentType()
.setBundleContext(context)
.setClassName(MyComponentImpl.class.getName())
.addDependency(new Dependency().setField("myFoo").setOptional(true))
.setComponentTypeName("singleton.optional.consumer")
.setValidateMethod("start");
return (SingletonComponentType) type;