CompositeService extends AbstractService { protected void addService(Service service) { if (LOG.isDebugEnabled()) { LOG.debug("Adding service " + service.getName()); } synchronized (serviceList) { serviceList.add(service); } } CompositeService(String name); List<Service> getServices();  }
@Test(timeout = 10000) public void testAddInitedSiblingInStop() throws Throwable { CompositeService parent = new CompositeService("parent"); BreakableService sibling = new BreakableService(); sibling.init(new Configuration()); parent.addService(new AddSiblingService(parent, sibling, STATE.STOPPED)); parent.init(new Configuration()); }