### Question:
SynthBassOptions implements ISynthBassGenerator { @Override public List<BasslineWithRating> distributeByWeights(List<BasslineWithRating> basslineWithRatings) { List<BasslineWithRating> distributedBasslines = new ArrayList<>(); for (BasslineWithRating basslineWithRating : basslineWithRatings) { for (int i = 0; i < basslineWithRating.getTotalWeight(); i++) { distributedBasslines.add(basslineWithRating); } } return distributedBasslines; } @Autowired  SynthBassOptions(IBasslineWeighter basslineWeighter,
                            @Value("${bypass_bassline_vertical_rating}") boolean bypassBasslineVerticalRating,
                            @Value("${num_of_generated_mixes}") Integer numOfGeneratedMixes
    ); void generateSynthBassOptions(ProgressionUnit progressionUnit, List<Bassline> basslines, HashMap<Integer, List<BasslineWithRating>> basslineMap); @Override List<BasslineWithRating> distributeByWeights(List<BasslineWithRating> basslineWithRatings); @Override void setSynthBassOptions(ProgressionUnit progressionUnit, List<Bassline> basslines, HashMap<Integer, List<BasslineWithRating>> basslineMap, Integer bpm); int getBassCode(Chord chordOne, Chord chordTwo, int bassOctave); void populateBasslinesByCode(List<Bassline> basslineSource, int bassCode, HashMap<Integer, List<BasslineWithRating>> basslineMap); int[] generateBeatArrayFromBassline(Bassline bassline); Pattern generateBasslinePattern(Intervals intervalsA, Intervals intervalsB, int[] beats, int bassOctave, Integer bpm); List<String> convertToNoteMap(int[] arpeggioList, Intervals intervalsA, Intervals intervalsB); @Override String transposeChord(String chord, int bassOctave); static final int BASS_OCTAVE; }### Answer:
@Test public void should_distribute_basslines(){ BasslineWithRating bassA = new BasslineWithRating(); bassA.incrementWeight(WeightClass.BAD); BasslineWithRating bassB = new BasslineWithRating(); bassB.incrementWeight(WeightClass.OK); BasslineWithRating bassC = new BasslineWithRating(); bassC.incrementWeight(WeightClass.GOOD); List<BasslineWithRating> inputOptions = Arrays.asList(bassA, bassB, bassC); List<BasslineWithRating> distributedOptions = synthBassGenerator.distributeByWeights(inputOptions); List<BasslineWithRating> oneRated = distributedOptions.stream().filter(options -> options.getTotalWeight() == 1).collect(Collectors.toList()); List<BasslineWithRating> 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); }