### Question:
BulkMutationGCJClient implements IBulkMutation { @Override public synchronized ApiFuture<Void> add(RowMutationEntry rowMutation) { Preconditions.checkNotNull(rowMutation, "mutation details cannot be null"); return bulkMutateBatcher.add(rowMutation); } BulkMutationGCJClient(Batcher<RowMutationEntry, Void> bulkMutateBatcher); @Override synchronized ApiFuture<Void> add(RowMutationEntry rowMutation); @Override void sendUnsent(); @Override void flush(); @Override void close();  }### Answer:
@Test public void testAdd() { SettableApiFuture<Void> future = SettableApiFuture.create(); when(batcher.add(rowMutation)).thenReturn(future); ApiFuture<Void> result = bulkMutationClient.add(rowMutation); assertFalse(result.isDone()); future.set(null); assertTrue(result.isDone()); verify(batcher).add(rowMutation); }
@Test(expected = ExecutionException.class) public void testAddFailure() throws Exception { SettableApiFuture<Void> future = SettableApiFuture.create(); when(batcher.add(rowMutation)).thenReturn(future); future.setException(new RuntimeException("can not perform mutation")); ApiFuture<Void> result = bulkMutationClient.add(rowMutation); assertTrue(result.isDone()); verify(batcher).add(rowMutation); result.get(); }