@Test
public void testTableExistsFalse() throws IOException {

  IOException fakeNotFoundException = new IOException("Fake not found exception");
  when(mockBigqueryTablesGet.execute()).thenThrow(fakeNotFoundException);
  when(mockErrorExtractor.itemNotFound(any(IOException.class))).thenReturn(true);
  boolean exists = helper.tableExists(tableRef);
  // Verify correct calls are made.
  verify(mockBigquery, times(1)).tables();
  verify(mockBigqueryTables, times(1)).get(eq(projectId), eq(datasetId), eq(tableId));
  verify(mockBigqueryTablesGet, times(1)).execute();
  verify(mockErrorExtractor, times(1)).itemNotFound(eq(fakeNotFoundException));
  assertThat(exists).isFalse();
}