@Test
public void testSyncWithProgressNonUi() throws Exception {

  StudioProgressRunner runner = new StudioProgressRunner(true, false, "test", null);
  AtomicBoolean invoked = new AtomicBoolean(false);
  ProgressRunner.ProgressRunnable runnable = (indicator, runner1) -> {
    assertFalse(ApplicationManager.getApplication().isDispatchThread());
    try {
      Thread.sleep(100);
    }
    catch (InterruptedException e) {
      fail();
    }
    invoked.set(true);
  };
  runner.runSyncWithProgress(runnable);
  assertTrue(invoked.get());
}