@Test
public void newBatch() {

  when(datastore.newBatch()).thenReturn(batch);
  var instrumentedBatch = instrumentedDatastore.newBatch();
  verify(datastore).newBatch();
  verifyNoMoreInteractions(datastore);
  reset(datastore);
  testBatchWriter(instrumentedBatch, batch);
  instrumentedBatch.submit();
  verify(batch).submit();
  verifyNoMoreInteractions(batch);
  reset(batch);
  when(batch.getDatastore()).thenReturn(datastore);
  var instrumentedDatastore = instrumentedBatch.getDatastore();
  assertThat(instrumentedDatastore, instanceOf(InstrumentedDatastore.class));
  assertThat(((InstrumentedDatastore) instrumentedDatastore).delegate(), is(datastore));
  verify(batch).getDatastore();
  verifyNoMoreInteractions(batch);
}