@Test
public void testReadRows() throws IOException {

  Query query = Query.create(TABLE_ID).rowKey(ROW_KEY);
  when(mockDataClient.readRowsCallable(Mockito.<RowResultAdapter>any()))
      .thenReturn(mockStreamingCallable)
      .thenReturn(mockStreamingCallable);
  when(serverStream.iterator())
      .thenReturn(
          ImmutableList.of(Result.EMPTY_RESULT, EXPECTED_RESULT, EXPECTED_RESULT).iterator())
      .thenReturn(ImmutableList.<Result>of().iterator());
  when(mockStreamingCallable.call(query)).thenReturn(serverStream).thenReturn(serverStream);
  ResultScanner resultScanner = dataClientWrapper.readRows(query);
  assertResult(Result.EMPTY_RESULT, resultScanner.next());
  assertResult(EXPECTED_RESULT, resultScanner.next());
  doNothing().when(serverStream).cancel();
  resultScanner.close();
  ResultScanner noRowsResultScanner = dataClientWrapper.readRows(query);
  assertNull(noRowsResultScanner.next());
  verify(serverStream).cancel();
  verify(mockDataClient, times(2)).readRowsCallable(Mockito.<RowResultAdapter>any());
  verify(serverStream, times(2)).iterator();
  verify(mockStreamingCallable, times(2)).call(query);
}