code: public void probe(long timeoutInMs) {
      long start = System.nanoTime();
  
      try {
        while (!condition.call() && (elapsedMs(start) < timeoutInMs)) {
          Thread.yield();
        }
  
        if (!condition.call()) {
          throw new IllegalStateException("probe condition not true after " + timeoutInMs);
        }
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
docs: Start probing, waiting for {@code condition} to become true.
  <p/>
  <p>This method is blocking: It returns when condition becomes true or throws an exception if timeout is reached.</p>
  
  @param timeoutInMs wait time in milliseconds