/*
* Returns "fragment" or "bundle" capability.
*/
private Capability getHostCapability(Capability[] capabilities) {
Capability bundleCapability = null;
if (capabilities != null) {
for (Capability capability : capabilities) {
if (Capability.BUNDLE.equals(capability.getName()) && bundleCapability == null) {
bundleCapability = capability;
} else if (Capability.FRAGMENT.equals(capability.getName())) {