@Override
  public Reiterator<ShuffleEntry> read(
      @Nullable ShufflePosition startPosition, @Nullable ShufflePosition endPosition) {
    return new ShuffleReadIterator(startPosition, endPosition);
  }
@Test
  public void readerIteratorCanBeCopied() throws Exception {
    ShuffleEntry e1 = newShuffleEntry(KEY, SKEY, VALUE);
    ShuffleEntry e2 = newShuffleEntry(KEY, SKEY, VALUE);
    ArrayList<ShuffleEntry> entries = new ArrayList<>();
    entries.add(e1);
    entries.add(e2);
    when(batchReader.read(START_POSITION, END_POSITION))
        .thenReturn(new ShuffleBatchReader.Batch(entries, null));
    Reiterator<ShuffleEntry> it = reader.read(START_POSITION, END_POSITION);
    assertThat(it.hasNext(), equalTo(Boolean.TRUE));
    assertThat(it.next(), equalTo(e1));
    Reiterator<ShuffleEntry> copy = it.copy();
    assertThat(it.hasNext(), equalTo(Boolean.TRUE));
    assertThat(it.next(), equalTo(e2));
    assertThat(it.hasNext(), equalTo(Boolean.FALSE));
    assertThat(copy.hasNext(), equalTo(Boolean.TRUE));
    assertThat(copy.next(), equalTo(e2));
    assertThat(copy.hasNext(), equalTo(Boolean.FALSE));
  }