@Deprecated
  public static <T> Task<T> callable(final String name, final Callable<? extends T> callable) {
    return Task.callable(name, () -> callable.call());
  }
@Test
  public void testDelayTaskCompleted() throws InterruptedException {
    final Task<Integer> task = Task.callable(() -> 1234);
    final Task<Integer> taskWithDelay = task.withDelay(1, TimeUnit.SECONDS);

    getEngine().run(taskWithDelay);

    taskWithDelay.await(200, TimeUnit.MILLISECONDS);
    // Both tasks should not be completed yet, since the delay is currently still ongoing.
    assertFalse(taskWithDelay.isDone());
    assertFalse(task.isDone());

    taskWithDelay.await(3, TimeUnit.SECONDS);
    // Both tasks should now be completed.
    assertTrue(taskWithDelay.isDone());
    assertTrue(task.isDone());
    // Both tasks should not have failed.
    assertFalse(task.isFailed());
    assertFalse(taskWithDelay.isFailed());

    // The promise should be resolved and the underlying task's value should be cascaded to the top level task.
    assertEquals(1234, taskWithDelay.get().intValue());
  }