RealtimeModel extends TimeModel implements RealtimeClockController { boolean isExecutorAlive() { return realtimeState.executor != null && !realtimeState.executor.isTerminated(); } RealtimeModel(RealtimeBuilder builder); @Override void stop(); @SuppressWarnings("deprecation") @Deprecated @Override void tick(); @Override boolean isTicking(); @Override void switchToRealTime(); @Override void switchToSimulatedTime(); @Override ClockMode getClockMode(); ImmutableList<RealtimeTickInfo> getTickInfoList(); @Override @Nonnull U get(Class<U> clazz);  }
@Test public void testStartStopStart() { final LimitingTickListener ltl = new LimitingTickListener(getModel(), 3); getModel().register(ltl); getModel().start(); boolean fail = false; try { getModel().start(); } catch (final IllegalStateException e) { fail = true; assertThat(e.getMessage()).contains("can be started only once"); } assertThat(fail).isTrue(); assertThat(getModel().isExecutorAlive()).isFalse(); }