@Test
public void testCompleted() throws Exception {

    final ComplexFuture<Object> future = new ComplexFuture<>(null);
    final Future<Object> dependency1 = new BasicFuture<>(null);
    future.setDependency(dependency1);
    Assert.assertFalse(future.isDone());
    future.completed(Boolean.TRUE);
    Assert.assertThat(future.isCancelled(), CoreMatchers.is(false));
    Assert.assertThat(dependency1.isCancelled(), CoreMatchers.is(false));
    final Future<Object> dependency2 = new BasicFuture<>(null);
    future.setDependency(dependency2);
    Assert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
}