@Deprecated
  public static <T> Task<T> withSideEffect(final Task<T> parent, final Task<?> sideEffect) {
    return parent.withSideEffect(t -> sideEffect);
  }
@Test
  public void testSideEffectFullCompletion() throws InterruptedException {
    // ensure that the individual side effect task will be run
    Task<String> taskOne = new BaseTask<String>() {
      @Override
      protected Promise<? extends String> run(Context context) throws Exception {
        return Promises.value("one");
      }
    };

    Task<String> taskTwo = new BaseTask<String>() {
      @Override
      protected Promise<? extends String> run(Context context) throws Exception {
        return Promises.value("two");
      }
    };

    Task<String> withSideEffect = taskOne.withSideEffect(x -> taskTwo);
    runAndWait("TestTasks.testSideEffectFullCompletion", withSideEffect);
    taskTwo.await();
    assertTrue(withSideEffect.isDone());
    assertTrue(taskTwo.isDone());
  }