### Question:
RLEIterator { public int next(int n) { if(n>0){ while(index<len){ if(seq[index]==0){ index+=2; }else if(seq[index]<n){ n=n-seq[index]; index+=2; }else if(seq[index]>=n){ seq[index]=seq[index]-n; return seq[index+1]; } } } return -1; } RLEIterator(int[] A); int next(int n);  }### Answer:
@Test public void firstTest(){ int groundTruth= iterator.next(2); Assertions.assertEquals(8,groundTruth); }