### Question:
ArpeggioGenerator implements IArpeggioGenerator { @Override public List<Arpeggio> distributeWeightedArpeggios(List<Arpeggio> weightedArpeggios) { List<Arpeggio> distributedBasslines = new ArrayList<>(); for (Arpeggio arrpeggioWithRating : weightedArpeggios) { for (int i = 0; i < arrpeggioWithRating.getTotalWeight(); i++) { distributedBasslines.add(arrpeggioWithRating); } } return distributedBasslines; } @Autowired  ArpeggioGenerator(IArpeggioSelector arpeggioSelector, IMidiWeighter midiWeighter, @Value("${num_of_generated_mixes}") Integer numOfGeneratedMixes); List<Integer> generateTemplate(List<ProgressionUnit> progressionUnits, ProgressionType unitType); List<String> convertToNoteMap(int[] arpeggioList, Intervals intervalsA, Intervals intervalsB); Map<Integer, List<Arpeggio>> getArpeggioOptions(List<ProgressionUnit> progressionUnits, ProgressionUnit.ProgressionType unitType, SourceData sourceData); @Override List<Arpeggio> distributeWeightedArpeggios(List<Arpeggio> weightedArpeggios); @Override Map<Integer, Arpeggio> selectFromARateDistributedList(Map<Integer, List<Arpeggio>> weightedArpeggios); @Override void weightArpeggioOptions(List<ProgressionUnit> progressionUnits, ProgressionType unitType, Map<Integer, List<Arpeggio>> arpeggioMap); @Override void setPatternWithTemplate(List<ProgressionUnit> progressionUnits, ProgressionType unitType, Map<Integer, Arpeggio> selectedArpeggios, SourceData sourceData, Integer bpm);  }### Answer:
@Test public void should_distribute_basslines() { Arpeggio arpeggioA = new Arpeggio(); arpeggioA.incrementWeight(WeightClass.BAD); Arpeggio arpeggioB = new Arpeggio(); arpeggioB.incrementWeight(WeightClass.OK); Arpeggio arpeggioC = new Arpeggio(); arpeggioC.incrementWeight(WeightClass.GOOD); List<Arpeggio> inputOptions = Arrays.asList(arpeggioA, arpeggioB, arpeggioC); List<Arpeggio> distributedOptions = arpeggioGenerator.distributeWeightedArpeggios(inputOptions); List<Arpeggio> oneRated = distributedOptions.stream().filter(options -> options.getTotalWeight() == 1).collect(Collectors.toList()); List<Arpeggio> twoRated = distributedOptions.stream().filter(options -> options.getTotalWeight() == 2).collect(Collectors.toList()); assertThat(distributedOptions.size()).isEqualTo(3); assertThat(oneRated.size()).isEqualTo(1); assertThat(twoRated.size()).isEqualTo(2); }