@Test
public void testFutureCallInitialCancel() throws Exception {

  String opName = "testFutureCallInitialCancel";
  OperationSnapshot initialOperation = getOperation(opName, null, null, null, false);
  OperationSnapshot resultOperation = getOperation(opName, null, null, null, false);
  UnaryCallable<Integer, OperationSnapshot> initialCallable =
      mockGetOpSnapshotCallable(StatusCode.Code.OK, initialOperation);
  LongRunningClient longRunningClient = mockGetOperation(StatusCode.Code.OK, resultOperation);
  OperationCallableImpl<Integer, Color, Currency> callableImpl =
      Callables.longRunningOperationImpl(
          initialCallable, callSettings, initialContext, longRunningClient);
  OperationFutureImpl<Color, Currency> future =
      callableImpl.futureCall(
          new ListenableFutureToApiFuture<>(
              Futures.<OperationSnapshot>immediateCancelledFuture()),
          FakeCallContext.createDefault());
  Exception exception = null;
  try {
    future.get(3, TimeUnit.SECONDS);
  } catch (CancellationException e) {
    exception = e;
  }
  assertThat(exception).isNotNull();
  assertThat(future.isDone()).isTrue();
  assertThat(future.isCancelled()).isTrue();
  assertThat(future.getInitialFuture().isDone()).isTrue();
  assertThat(future.getInitialFuture().isCancelled()).isTrue();
  assertFutureCancelMetaCancel(future);
  assertThat(executor.getIterationsCount()).isEqualTo(0);
}