code: public synchronized boolean waitForRestartSolverDecision() {
          if (!daemon) {
              return !problemFactChangeQueue.isEmpty() && !terminatedEarly;
          } else {
              while (problemFactChangeQueue.isEmpty() && !terminatedEarly) {
                  try {
                      wait();
                  } catch (InterruptedException e) {
                      Thread.currentThread().interrupt();
                      throw new IllegalStateException("Solver thread was interrupted during Object.wait().", e);
                  }
              }
              return !terminatedEarly;
          }
      }
docs: If this returns true, then the problemFactChangeQueue is definitely not empty.
  <p>
  Concurrency note: Blocks until {@link #problemFactChangeQueue} is not empty or {@link #terminatedEarly} is true.
  @return true if the solver needs to be restarted