@Test public void testPropagateCancellation_innerDoesNotSupportToCompletableFuture() {

  CompletableFuture<String> outer = new CompletableFuture<>();
  CompletableFuture<String> inner = Mockito.spy(new CompletableFuture<>());
  assertThat(Utils.propagateCancellation(outer, inner)).isSameAs(outer);
  Mockito.doThrow(new UnsupportedOperationException()).when(inner).toCompletableFuture();
  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()).isFalse();
  assertThrows(CancellationException.class, outer::get);
}