RtSolverModel extends AbstractModel<RtSolverUser> implements TickListener { @Override public <U> U get(Class<U> clazz) { if (clazz == RtSolverModelAPI.class) { return clazz.cast(new RtSolverModelAPI()); } else if (clazz == RtSimSolverBuilder.class) { if (mode == Mode.UNKNOWN) { mode = Mode.SINGLE_MODE; initExecutor(); } return clazz.cast(new RtSimSolverBuilderImpl()); } throw new IllegalArgumentException( getClass().getSimpleName() + " does not provide " + clazz); } RtSolverModel(RealtimeClockController c, PDPRoadModel rm, PDPModel pm,
      Mode m, int threads, boolean threadGrouping); @Override boolean register(RtSolverUser element); @Override boolean unregister(RtSolverUser element); @Override U get(Class<U> clazz); @Override void tick(TimeLapse timeLapse); @Override void afterTick(TimeLapse timeLapse); @CheckReturnValue static Builder builder(); static final int DEFAULT_NUM_THREADS_IN_SINGLE_MODE; }
@Test public void testGetFail() { boolean fail = false; try { model.get(Object.class); } catch (final IllegalArgumentException e) { fail = true; assertThat(e.getMessage()).contains( " does not provide " + Object.class.toString()); } assertThat(fail).isTrue(); }