code: private void waitForCompletions(long timeoutMs) throws InterruptedException {
      Long completedOperation =
          this.completedOperationIds.pollFirst(timeoutMs, TimeUnit.MILLISECONDS);
      if (completedOperation != null) {
        markOperationComplete(completedOperation);
      }
    }
docs: Waits for a completion and then marks it as complete.
  @throws InterruptedException