@Test
public void testUnmodifiableFutureCancelPropagation()
{

    CompletableFuture<String> future = new CompletableFuture<>();
    CompletableFuture<String> unmodifiableFuture = unmodifiableFuture(future, true);
    assertTrue(unmodifiableFuture.cancel(false));
    assertTrue(future.isDone());
    assertTrue(future.isCancelled());
    assertTrue(unmodifiableFuture.isDone());
    assertTrue(unmodifiableFuture.isCancelled());
    future = new CompletableFuture<>();
    unmodifiableFuture = unmodifiableFuture(future, true);
    assertTrue(unmodifiableFuture.cancel(true));
    assertTrue(future.isDone());
    assertTrue(future.isCancelled());
    assertTrue(unmodifiableFuture.isDone());
    assertTrue(unmodifiableFuture.isCancelled());
    future = new CompletableFuture<>();
    unmodifiableFuture = unmodifiableFuture(future, true);
    assertTrue(unmodifiableFuture.completeExceptionally(new CancellationException()));
    assertTrue(future.isDone());
    assertTrue(future.isCancelled());
    assertTrue(unmodifiableFuture.isDone());
    assertTrue(unmodifiableFuture.isCancelled());
}