Waits if necessary for at most the given time for this future
to complete, and then returns its result, if available.
@param timeout the maximum time to wait
@param unit the time unit of the timeout argument
@return the result value
@throws CancellationException if this future was cancelled
@throws ExecutionException if this future completed exceptionally
@throws InterruptedException if the current thread was interrupted
while waiting
@throws TimeoutException if the wait timed out
Waits if necessary for at most the given time for this future to complete, and then returns its result, if available.
@param timeout the maximum time to wait @param unit the time unit of the timeout argument @return the result value @throws CancellationException if this future was cancelled @throws ExecutionException if this future completed exceptionally @throws InterruptedException if the current thread was interrupted while waiting @throws TimeoutException if the wait timed out