code: public void waitForState(State state, Timespan timeout)
      throws TimeoutException, InterruptedException
    {
      long endTime = timeout == null ? 0 : timeout.futureTimeMillis(_clock);
  
      synchronized(_lock)
      {
        while(_state != state)
        {
          ConcurrentUtils.awaitUntil(_clock, _lock, endTime);
        }
      }
    }
docs: Wait (no longer than timeout if provided) for the client to be started