code: public static <ResultT, ExceptionT extends Exception> ResultT getAndHandleExceptions(Future<ResultT> future,
                                                                                           Function<Throwable, ExceptionT> exceptionConstructor) throws ExceptionT {
          Preconditions.checkNotNull(exceptionConstructor);
          try {
              return Exceptions.handleInterruptedCall(() -> future.get());
          } catch (ExecutionException e) {
              ExceptionT result = exceptionConstructor.apply(e.getCause());
              if (result == null) {
                  return null;
              } else {
                  throw result;
              }
          }
      }
docs: Calls get on the provided future, handling interrupted, and transforming the executionException into an exception
  of the type whose constructor is provided.
  
  @param future               The future whose result is wanted
  @param exceptionConstructor This can be any function that either transforms an exception
  i.e. Passing RuntimeException::new will wrap the exception in a new RuntimeException.
  If null is returned from the function no exception will be thrown.
  @param <ResultT>            Type of the result.
  @param <ExceptionT>         Type of the Exception.
  @return The result of calling future.get()
  @throws ExceptionT If thrown by the future.