@Test
public void testBothFutureSuccessAndBackupFinishesFirst() {

  Future<Integer> originalFuture = getFuture(1000, 1, true);
  Function0<Future<Integer>> backupFunctionFuture = getBackupFutureFunctionWithSuccess(200, 2);
  Future<Integer> speculativeFuture = FutureUtil.getSpeculativeFuture(
      originalFuture, backupFunctionFuture, 100, STATS_PREFIX);
  int value = speculativeFuture.get().intValue();
  assertTrue(isBackupFutureInvoked);
  assertEquals(2, value);
  checkStats(1, 0, 1);
}