Scenario { public static Builder builder() { return builder(DEFAULT_PROBLEM_CLASS); } protected  Scenario(); abstract ImmutableList<TimedEvent> getEvents(); Queue<TimedEvent> asQueue(); abstract ImmutableSet<ModelBuilder<?, ?>> getModelBuilders(); abstract TimeWindow getTimeWindow(); abstract StopCondition getStopCondition(); abstract ProblemClass getProblemClass(); abstract String getProblemInstanceId(); @Override abstract boolean equals(@Nullable Object other); @Override abstract int hashCode(); static Builder builder(); static Builder builder(Scenario scenario); static Builder builder(ProblemClass problemClass); static Builder builder(AbstractBuilder<?> base,
      ProblemClass problemClass); static final ProblemClass DEFAULT_PROBLEM_CLASS; }
@Test(expected = IllegalArgumentException.class) public void testEnsureFrequencyFailFrequency() { Scenario.builder(Scenario.DEFAULT_PROBLEM_CLASS) .ensureFrequency(Predicates.<TimedEvent>alwaysTrue(), -1); }
@Test(expected = IllegalStateException.class) public void testEnsureFrequencyFailEmptyEventsList() { Scenario.builder(Scenario.DEFAULT_PROBLEM_CLASS) .ensureFrequency(Predicates.<TimedEvent>alwaysTrue(), 1); }
@Test public void testRemoveModelsOfType() { final Scenario.Builder builder = Scenario.builder(); builder.addModel(TimeModel.builder()) .addModel(TimeModel.builder().withRealTime()) .addModel(RoadModelBuilders.plane()) .addModel(CommModel.builder()); assertThat(builder.modelBuilders).hasSize(4); builder.removeModelsOfType(RoadModelBuilders.PlaneRMB.class); assertThat(builder.modelBuilders).hasSize(3); assertThat(builder.modelBuilders).containsExactly(TimeModel.builder(), TimeModel.builder().withRealTime(), CommModel.builder()); builder.removeModelsOfType(RoadModelBuilders.AbstractGraphRMB.class); builder.removeModelsOfType(TimeModel.AbstractBuilder.class); assertThat(builder.modelBuilders).hasSize(1); assertThat(builder.modelBuilders).containsExactly(CommModel.builder()); builder.removeModelsOfType(CommModel.Builder.class); assertThat(builder.modelBuilders).isEmpty(); }