### Question:
SetSnareMidiPatternEvent implements IEventChain { @Override public QueueState set(QueueState queueState) { for(ProgressionUnit pUnit : queueState.getStructure()) { String jfugueStr = "T" + queueState.getQueueItem().getBpm() + " "; for (ProgressionUnitBar pBar : pUnit.getProgressionUnitBars()) { for (Integer k : pBar.getSnarePattern().getAsIntegerArray()) { jfugueStr += intToDuration(pUnit.getKey(), k) + " "; } pBar.setSnareMidiPattern(new Pattern(jfugueStr)); } } return queueState; }  @Override QueueState set(QueueState queueState);  }### Answer:
@Test public void shouldSetMidiPattern(){ setSnarePatternEvent = new SetSnareMidiPatternEvent(); queueState = setSnarePatternEvent.set(queueState); Pattern p1b1 = queueState.getQueueItem().getProgression().getStructure().get(0).getProgressionUnitBars().get(0).getSnareMidiPattern(); Pattern p2b1 = queueState.getQueueItem().getProgression().getStructure().get(1).getProgressionUnitBars().get(0).getSnareMidiPattern(); assertThat(p1b1.toString()).isEqualToIgnoringCase("T77 f#3s rs f#3s rs f#3s rs f#3s rs f#3s rs f#3s rs f#3s rs f#3s rs "); assertThat(p2b1.toString()).isEqualToIgnoringCase("T77 rs rs f#3s f#3s rs rs f#3s f#3s rs rs f#3s f#3s rs rs f#3s f#3s "); }