OptionalDependencyItem is only there to wire together beans that actually existed - to be properly unwinded on undeploy.
But I guess similar dependency item could be added from the beginning.
You would only need to override unresolved() method,
to only return true when the dependent bean exists.
I just didn't introduce it, as it would always return true on isResolved() call.
Where we actually only need it when dependency exists.