private static void spinWhileWatchdogAlive(IdeaWatchdog watchdog) throws Exception {
    long waitTime = watchdog.getWaitTimeoutMillis();
    Object lock = new Object();
    while (true) {
      //noinspection SynchronizationOnLocalVariableOrMethodParameter
      synchronized (lock) {
        lock.wait(waitTime);
      }
      if (!watchdog.isAlive()) {
        System.exit(1);
      }
    }
  }
private static void spinWhileWatchdogAlive(IdeaWatchdog watchdog)