container.registerComponentInstance(childStartable.proxy());
}
};
LifecycleContainerBuilder builder = new DefaultLifecycleContainerBuilder(containerComposer);
ObjectReference parentRef = new SimpleReference();
MutablePicoContainer parent = new DefaultPicoContainer();
Mock parentStartable = mock(Startable.class);
parent.registerComponentInstance(parentStartable.proxy());
parentRef.set(parent);
ObjectReference childRef = new SimpleReference();
builder.buildContainer(childRef, parentRef, null, true);
PicoContainer childContainer = (PicoContainer) childRef.get();
//PicoContainer.getParent() is now ImmutablePicoContainer
assertNotSame(parent, childContainer.getParent());
builder.killContainer(childRef);
}