public static void assertUnderProgress(@NotNull ProgressIndicator indicator) {
    synchronized (threadsUnderIndicator) {
      Set<Thread> threads = threadsUnderIndicator.get(indicator);
      if (threads == null || !threads.contains(Thread.currentThread())) {
        ProgressIndicator current = threadTopLevelIndicators.get(Thread.currentThread().getId());
        LOG.error("Must be executed under progress indicator: " + indicator + " but the process is running under "+current+" indicator instead. Please see e.g. ProgressManager.runProcess()");
      }
    }
  }
public static void assertUnderProgress(@NotNull ProgressIndicator indicator)