@Test
public void testOriginalFailsAndBackupFinishesFirst() {

  Future<Integer> originalFuture = getFuture(500, 1, false);
  Function0<Future<Integer>> backupFunctionFuture = getBackupFutureFunctionWithSuccess(10, 2);
  Future<Integer> speculativeFuture = FutureUtil.getSpeculativeFuture(
      originalFuture, backupFunctionFuture, 100, STATS_PREFIX);
  assertEquals(2, speculativeFuture.get().intValue());
  assertTrue(isBackupFutureInvoked);
  checkStats(1, 0, 1);
}