FooImpl targetFoo = new FooImpl();
EasyMock.expect(parent.resolveSystemInstance(EasyMock.eq(Foo.class))).andReturn(targetFoo);
EasyMock.replay(parent);
AtomicComponent component = builder.build(parent, definition, deploymentContext);
component.start();
container.onEvent(new CompositeStart(this, null));
FooImpl2 foo = (FooImpl2) component.getServiceInstance();
assertNotNull(foo.getRef());
container.onEvent(new CompositeStop(this, null));
EasyMock.verify(parent);
}