@Test public void ShouldSetCorrectHiSynthB() { SynthTemplateOption hiSynth = new SynthTemplateOption(1, "one", SynthTemplateOption.SynthRoll.SYNTH_HI); hiSynth.setWeightClass(WeightClass.GOOD); SynthTemplateOption hiAltSynth = new SynthTemplateOption(2, "two", SynthTemplateOption.SynthRoll.SYNTH_HI); hiAltSynth.setWeightClass(WeightClass.OK); List<SynthTemplateOption> synthOptions = new ArrayList<>(); synthOptions.add(hiSynth); synthOptions.add(hiAltSynth); ProgressionUnitBar pBar = new ProgressionUnitBar(); pBar.setSynthTemplateHiOptions(Arrays.asList(synthOptions, synthOptions)); synthTemplatePrimeOrAltSelector.setHiSynths(pBar); assertThat(pBar.getHiSynthId()).hasSize(2); assertThat(pBar.getHiSynthId().get(1)).isEqualTo(1); }
public void setHiSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateHiOptions().size(); i++){ SynthTemplateOption hiSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(0); SynthTemplateOption hiAltSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(1); if(hiSynth.getWeightClass().getValue() > hiAltSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiSynth.getId()); } else if(hiAltSynth.getWeightClass().getValue() > hiSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiAltSynth.getId()); } else { progressionUnitBar.addHiSynthId(hiSynth.getId()); } } }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setHiSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateHiOptions().size(); i++){ SynthTemplateOption hiSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(0); SynthTemplateOption hiAltSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(1); if(hiSynth.getWeightClass().getValue() > hiAltSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiSynth.getId()); } else if(hiAltSynth.getWeightClass().getValue() > hiSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiAltSynth.getId()); } else { progressionUnitBar.addHiSynthId(hiSynth.getId()); } } } }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setHiSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateHiOptions().size(); i++){ SynthTemplateOption hiSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(0); SynthTemplateOption hiAltSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(1); if(hiSynth.getWeightClass().getValue() > hiAltSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiSynth.getId()); } else if(hiAltSynth.getWeightClass().getValue() > hiSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiAltSynth.getId()); } else { progressionUnitBar.addHiSynthId(hiSynth.getId()); } } }  }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setHiSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateHiOptions().size(); i++){ SynthTemplateOption hiSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(0); SynthTemplateOption hiAltSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(1); if(hiSynth.getWeightClass().getValue() > hiAltSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiSynth.getId()); } else if(hiAltSynth.getWeightClass().getValue() > hiSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiAltSynth.getId()); } else { progressionUnitBar.addHiSynthId(hiSynth.getId()); } } }  void setHiSynths(ProgressionUnitBar progressionUnitBar); void setMidSynths(ProgressionUnitBar progressionUnitBar); void setLowSynths(ProgressionUnitBar progressionUnitBar); QueueState setRhythm(QueueState queueState); boolean randomSelection(); }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setHiSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateHiOptions().size(); i++){ SynthTemplateOption hiSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(0); SynthTemplateOption hiAltSynth = progressionUnitBar.getSynthTemplateHiOptions().get(i).get(1); if(hiSynth.getWeightClass().getValue() > hiAltSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiSynth.getId()); } else if(hiAltSynth.getWeightClass().getValue() > hiSynth.getWeightClass().getValue()){ progressionUnitBar.addHiSynthId(hiAltSynth.getId()); } else { progressionUnitBar.addHiSynthId(hiSynth.getId()); } } }  void setHiSynths(ProgressionUnitBar progressionUnitBar); void setMidSynths(ProgressionUnitBar progressionUnitBar); void setLowSynths(ProgressionUnitBar progressionUnitBar); QueueState setRhythm(QueueState queueState); boolean randomSelection();  }