code: public boolean waitForWithOptions() throws InterruptedException {
      try {
        // [START ]
        Job completedJob =
            job.waitFor(
                RetryOption.initialRetryDelay(Duration.ofSeconds(1)),
                RetryOption.totalTimeout(Duration.ofMinutes(1)));
        if (completedJob == null) {
          // job no longer exists
        } else if (completedJob.getStatus().getError() != null) {
          // job failed, handle error
        } else {
          // job completed successfully
        }
        // [END ]
      } catch (BigQueryException e) {
        if (e.getCause() instanceof PollException) {
          return false;
        }
        throw e;
      }
      return true;
    }
docs: [TARGET waitFor(RetryOption...)]