### Question:
ScenarioDefinition implements ImmutableBean { static <T> List<T> repeatItems(List<T> inputs, int totalCount, int groupSize) { ImmutableList.Builder<T> builder = ImmutableList.builder(); for (int i = 0; i < (totalCount / groupSize / inputs.size()); i++) { for (T input : inputs) { builder.addAll(Collections.nCopies(groupSize, input)); } } return builder.build(); } private  ScenarioDefinition(
      List<? extends PerturbationMapping<?>> mappings,
      List<String> scenarioNames); static ScenarioDefinition empty(); static ScenarioDefinition ofMappings(List<? extends PerturbationMapping<?>> mapping); static ScenarioDefinition ofMappings(PerturbationMapping<?>... mappings); static ScenarioDefinition ofMappings(
      List<? extends PerturbationMapping<?>> mappings,
      List<String> scenarioNames); int getScenarioCount(); static ScenarioDefinition.Meta meta(); static ScenarioDefinition.Builder builder(); @Override ScenarioDefinition.Meta metaBean(); ImmutableList<PerturbationMapping<?>> getMappings(); ImmutableList<String> getScenarioNames(); Builder toBuilder(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void repeatItems() { List<Integer> inputs = ImmutableList.of(1, 2, 3, 4); List<Integer> expected1 = ImmutableList.of(1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4); assertThat(ScenarioDefinition.repeatItems(inputs, 12, 1)).isEqualTo(expected1); List<Integer> expected2 = ImmutableList.of(1, 1, 2, 2, 3, 3, 4, 4); assertThat(ScenarioDefinition.repeatItems(inputs, 8, 2)).isEqualTo(expected2); List<Integer> expected3 = ImmutableList.of(1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4); assertThat(ScenarioDefinition.repeatItems(inputs, 12, 3)).isEqualTo(expected3); List<Integer> expected4 = ImmutableList.of(1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4); assertThat(ScenarioDefinition.repeatItems(inputs, 24, 3)).isEqualTo(expected4); }