Simulator implements SimulatorAPI { @Override public void unregister(Object o) { if (o instanceof Model<?>) { throw new IllegalArgumentException("can not unregister a model"); } toUnregister.add(o); } Simulator(Builder b); @SuppressWarnings("static-method") @Deprecated boolean register(Model<?> m); @Override void register(Object obj); @Override void unregister(Object o); ImmutableSet<Model<?>> getModels(); ModelProvider getModelProvider(); long getCurrentTime(); long getTimeStep(); void addTickListener(TickListener listener); void removeTickListener(TickListener listener); void start(); void togglePlayPause(); void stop(); void tick(); boolean isPlaying(); @Override RandomGenerator getRandomGenerator(); Unit<Duration> getTimeUnit(); static Builder builder();  }
@Test(expected = IllegalArgumentException.class) public void testUnregisterModel() { simulator.unregister(new DummyModel()); }