@Test
public void pollReturnsNullIfBothReadersAreStopped() throws InterruptedException {

    BinlogReader mockOldBinlogReader = mock(BinlogReader.class);
    SnapshotReader mockNewSnapshotReader = mock(SnapshotReader.class);
    BinlogReader mockNewBinlogReader = mock(BinlogReader.class);
    ParallelSnapshotReader parallelSnapshotReader = new ParallelSnapshotReader(mockOldBinlogReader, mockNewSnapshotReader, mockNewBinlogReader);
    when(mockOldBinlogReader.isRunning()).thenReturn(false);
    when(mockOldBinlogReader.poll()).thenThrow(new InterruptedException());
    when(mockNewBinlogReader.poll()).thenReturn(null);
    // 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(null, parallelRecords);
}