@Test
public void testToCompletableFuture_exception() throws Exception {

  ListeningExecutorService service =
      MoreExecutors.listeningDecorator(
          BigtableSessionSharedThreadPools.getInstance().getBatchThreadPool());
  ListenableFuture<String> listenableFuture =
      service.submit(
          new Callable<String>() {
            public String call() throws Exception {
              throw new IllegalStateException("Test failed feature");
            }
          });
  CompletableFuture<String> completableFuture = FutureUtils.toCompletableFuture(listenableFuture);
  thrown.expect(ExecutionException.class);
  thrown.expectCause(IsInstanceOf.<Throwable>instanceOf(IllegalStateException.class));
  thrown.expectMessage(containsString("Test failed feature"));
  completableFuture.get();
}