@Test
public void pollReturnsOldIfNewReaderIsStopped() throws InterruptedException {

    BinlogReader mockOldBinlogReader = mock(BinlogReader.class);
    SnapshotReader mockNewSnapshotReader = mock(SnapshotReader.class);
    BinlogReader mockNewBinlogReader = mock(BinlogReader.class);
    ParallelSnapshotReader parallelSnapshotReader = new ParallelSnapshotReader(mockOldBinlogReader, mockNewSnapshotReader, mockNewBinlogReader);
    SourceRecord oldBinlogSourceRecord = mock(SourceRecord.class);
    List<SourceRecord> oldBinlogRecords = new ArrayList<>();
    oldBinlogRecords.add(oldBinlogSourceRecord);
    when(mockOldBinlogReader.isRunning()).thenReturn(true);
    when(mockOldBinlogReader.poll()).thenReturn(oldBinlogRecords);
    // cheap way to have the new reader be stopped is to just not start it; so don't start the parallel reader
    List<SourceRecord> parallelRecords = parallelSnapshotReader.poll();
    Assert.assertEquals(1, parallelRecords.size());
    Assert.assertTrue(parallelRecords.contains(oldBinlogSourceRecord));
}