code: public Thread whenReportReady(final ReportCallback callback) {
      Preconditions.checkNotNull(callback, "Report callback cannot be null.");
  
      Thread waitThread = new Thread("ReportUtils.whenReportReady " + reportJobId) {
        @Override
        public void run() {
          try {
            if (waitForReportReady()) {
              callback.onSuccess();
            } else {
              callback.onFailure();
            }
          } catch (ApiException_Exception e) {
            callback.onException(e);
          } catch (InterruptedException e) {
            callback.onInterruption();
          } catch (RuntimeException e) {
            callback.onException(e);
          }
        }
      };
      waitThread.start();
      return waitThread;
    }
docs: Waits for the report to be ready and then calls:
  <ul>
  <li>{@link ReportCallback#onSuccess()} for a successful scheduling</li>
  <li>{@link ReportCallback#onFailure()} for a failed scheduling due to a
  {@link ReportJobStatus#FAILED}</li>
  <li>{@link ReportCallback#onInterruption()} if the wait thread is
  interrupted</li>
  <li>{@link ReportCallback#onException(Exception)} if there was an exception
  while waiting for the report to finish</li>
  </ul>
  
  @param callback the {@code ReportCallback} to call when the job has
  finished, successfully or otherwise
  @throws IllegalArgumentException if {@code callback == null}
  @return the thread created that handles waiting for the report.
  {@link Thread#interrupt()} can be called on the returned thread to
  interrupt it.