private static int determineWinner(FutureTask<Integer> task1, FutureTask<Integer> task2)
            throws InterruptedException,
            ExecutionException
    {
        boolean isDone = false;
        int winnerTime = 0;

        while (!isDone)
        {
            if (task1.isDone())
            {
                isDone = true;
                winnerTime = task1.get();
                task2.cancel(true);
            }
            else if (task2.isDone())
            {
                isDone = true;
                winnerTime = task2.get();
                task1.cancel(true);
            }
        }

        return winnerTime;
    }