class Futures {

  private static final Futures INSTANCE = new Futures();

  /**
   * Returns the singleton instance of this class.
   *
   * @return the singleton instance of this class.
   */
  public static Futures instance() {
    return INSTANCE;
  }

  @VisibleForTesting
  Failures failures = Failures.instance();

  /**
   * Verifies that the {@link Future} is cancelled.
   * @param info contains information about the assertion.
   * @param actual the "actual" {@code Date}.
   */
  public void assertIsCancelled(AssertionInfo info, Future<?> actual) {
    assertNotNull(info, actual);
    if (!actual.isCancelled())
      throw failures.failure(info, shouldBeCancelled(actual));
  }

  /**
   * Verifies that the {@link Future} is not cancelled.
   * @param info contains information about the assertion.
   * @param actual the "actual" {@code Date}.
   */
  public void assertIsNotCancelled(AssertionInfo info, Future<?> actual) {
    assertNotNull(info, actual);
    if (actual.isCancelled())
      throw failures.failure(info, shouldNotBeCancelled(actual));
  }

  /**
   * Verifies that the {@link Future} is done.
   * @param info contains information about the assertion.
   * @param actual the "actual" {@code Date}.
   */
  public void assertIsDone(AssertionInfo info, Future<?> actual) {
    assertNotNull(info, actual);
    if (!actual.isDone())
      throw failures.failure(info, shouldBeDone(actual));
  }

  /**
   * Verifies that the {@link Future} is not done.
   * @param info contains information about the assertion.
   * @param actual the "actual" {@code Date}.
   */
  public void assertIsNotDone(AssertionInfo info, Future<?> actual) {
    assertNotNull(info, actual);
    if (actual.isDone())
      throw failures.failure(info, shouldNotBeDone(actual));
  }

  public <RESULT> RESULT assertSucceededWithin(AssertionInfo info, Future<RESULT> actual, long timeout, TimeUnit unit) {
    assertNotNull(info, actual);
    try {
      return actual.get(timeout, unit);
    } catch (InterruptedException | ExecutionException | TimeoutException | CancellationException e) {
      throw failures.failure(info, shouldBeCompletedWithin(actual, timeout, unit, e));
    }
  }

  public <RESULT> RESULT assertSucceededWithin(AssertionInfo info, Future<RESULT> actual, Duration timeout) {<FILL_FUNCTION_BODY>}

  public Exception assertFailedWithin(AssertionInfo info, Future<?> actual, Duration timeout) {
    assertNotNull(info, actual);
    try {
      actual.get(timeout.toNanos(), TimeUnit.NANOSECONDS);
      throw failures.failure(info, shouldHaveFailedWithin(actual, timeout));
    } catch (InterruptedException | ExecutionException | TimeoutException | CancellationException e) {
      return e;
    }
  }

  public Exception assertFailedWithin(AssertionInfo info, Future<?> actual, long timeout, TimeUnit unit) {
    assertNotNull(info, actual);
    try {
      actual.get(timeout, unit);
      throw failures.failure(info, shouldHaveFailedWithin(actual, timeout, unit));
    } catch (InterruptedException | ExecutionException | TimeoutException | CancellationException e) {
      return e;
    }
  }

  private void assertNotNull(AssertionInfo info, Future<?> actual) {
    Objects.instance().assertNotNull(info, actual);
  }
}

    assertNotNull(info, actual);
    try {
      return actual.get(timeout.toNanos(), TimeUnit.NANOSECONDS);
    } catch (InterruptedException | ExecutionException | TimeoutException | CancellationException e) {
      throw failures.failure(info, shouldBeCompletedWithin(actual, timeout, e));
    }
  
<no_super_class>