### Question:
CommunityRuntime implements TransactionEventHandler<Map<String, Object>>, GraphAwareRuntime, KernelEventHandler { @Override public final void waitUntilStarted() { if (!isStarted(null)) { throw new IllegalStateException("It appears that the thread starting the runtime called waitUntilStarted() before it's finished its job. This is a bug"); } } protected  CommunityRuntime(RuntimeConfiguration configuration, GraphDatabaseService database, TxDrivenModuleManager<TxDrivenModule> txDrivenModuleManager, TimerDrivenModuleManager timerDrivenModuleManager, Neo4jWriter writer); @Override synchronized void registerModule(RuntimeModule module); @Override final synchronized void start(); @Override final void waitUntilStarted(); @Override Map<String, Object> beforeCommit(TransactionData data); @Override final void afterCommit(TransactionData data, Map<String, Object> states); @Override final void afterRollback(TransactionData data, Map<String, Object> states); @Override void beforeShutdown(); @Override M getModule(String moduleId, Class<M> clazz); @Override M getModule(Class<M> clazz); @Override final void kernelPanic(ErrorState error); @Override final Object getResource(); @Override final ExecutionOrder orderComparedTo(KernelEventHandler other); @Override RuntimeConfiguration getConfiguration(); @Override Neo4jWriter getDatabaseWriter();  }### Answer:
@Test(expected = IllegalStateException.class) public void shouldFailWaitingForRuntimeThatHasNotBeenStarted() { GraphAwareRuntime runtime = createRuntime(database); runtime.waitUntilStarted(); }