BulkMutationClassicApi implements BulkMutationWrapper { @Override public void close() throws IOException { isClosed = true; try { flush(); } catch (InterruptedException interruptedException) { throw new IOException(interruptedException); } } BulkMutationClassicApi(@Nonnull BulkMutation delegate); @Override ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close();  }
@Test public void testClose() throws IOException { bulkMutationWrapper.close(); try { bulkMutationWrapper.add(RowMutationEntry.create("key")); Assert.fail("bulk mutation should be closed"); } catch (IllegalStateException actualEx) { assertEquals("can't mutate when the bulk mutation is closed.", actualEx.getMessage()); } }