@Test
public void registerForFactoryServiceAvailability()
        throws Throwable {

    setUp(false);
    this.host.startFactoryServicesSynchronously(new TestFactoryService.SomeFactoryService(),
            SomeExampleService.createFactory());
    this.host.waitForServiceAvailable(SomeExampleService.FACTORY_LINK);
    this.host.waitForServiceAvailable(TestFactoryService.SomeFactoryService.SELF_LINK);
    try {
        // not a factory so will fail
        this.host.startFactoryServicesSynchronously(new ExampleService());
        throw new IllegalStateException("Should have failed");
    } catch (IllegalArgumentException e) {
    }
    try {
        // does not have SELF_LINK/FACTORY_LINK so will fail
        this.host.startFactoryServicesSynchronously(new MinimalFactoryTestService());
        throw new IllegalStateException("Should have failed");
    } catch (IllegalArgumentException e) {
    }
}