@Deprecated
  public static <T> Task<T> withSideEffect(final Task<T> parent, final Task<?> sideEffect) {
    return parent.withSideEffect(t -> sideEffect);
  }
@Test
  public void testSideEffectPartialCompletion() throws InterruptedException {
    // ensure that the whole can finish before the individual side effect task finishes.
    Task<String> fastTask = new BaseTask<String>() {
      @Override
      protected Promise<? extends String> run(Context context) throws Exception {
        return Promises.value("fast");
      }
    };

    // this task will not complete.
    Task<String> settableTask = new BaseTask<String>() {
      @Override
      protected Promise<? extends String> run(Context context) throws Exception {
        return Promises.settable();
      }
    };

    Task<String> withSideEffect = fastTask.withSideEffect(x -> settableTask);
    runAndWait("TestTasks.testSideEffectPartialCompletion", withSideEffect);
    assertTrue(withSideEffect.isDone());
    assertTrue(fastTask.isDone());
    assertFalse(settableTask.isDone());
  }