@Test
public void testBothFutureSuccessAndOriginalFinishesFirst() {

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