void (@NotNull ProgressIndicator indicator) { try { assertFalse(ModalityState.nonModal().equals(ModalityState.defaultModalityState())); assertEquals(ProgressManager.getInstance().getProgressIndicator().getModalityState(), ModalityState.defaultModalityState()); ProgressManager.getInstance().runProcess(() -> { assertSame(indicator.getModalityState(), ModalityState.defaultModalityState()); assertInvokeAndWaitWorks(); }, new ProgressIndicatorBase()); } catch (Throwable e) { throw new RuntimeException(e); // ProgressManager doesn't handle errors } }