@Test public void testPropagateCancellation_innerAlreadyCompleted() throws Exception {

  CompletableFuture<String> outer = new CompletableFuture<>();
  CompletableFuture<String> inner = new CompletableFuture<>();
  assertThat(Utils.propagateCancellation(outer, inner)).isSameAs(outer);
  inner.complete("inner");
  outer.cancel(false);
  assertThat(outer.isCancelled()).isTrue();
  assertThat(inner.isCancelled()).isFalse();
  assertThat(outer.isCompletedExceptionally()).isTrue();
  assertThat(inner.isCompletedExceptionally()).isFalse();
  assertThat(outer.isDone()).isTrue();
  assertThat(inner.isDone()).isTrue();
  assertThat(inner.get()).isEqualTo("inner");
}