@Test(timeout = 1000)
public void testAddStoppedChildBeforeInit() throws Throwable {

  CompositeService parent = new CompositeService("parent");
  BreakableService child = new BreakableService();
  child.init(new Configuration());
  child.start();
  child.stop();
  AddSiblingService.addChildToService(parent, child);
  try {
    parent.init(new Configuration());
    fail("Expected an exception, got " + parent);
  } catch (ServiceStateException e) {
    //expected
  }
  parent.stop();
}