void (@Nullable Project project, @Nullable Component component) { JComponent comp = ObjectUtils.tryCast(component, JComponent.class); ApplicationImpl app = (ApplicationImpl)ApplicationManager.getApplication(); boolean success = app.runWriteActionWithNonCancellableProgressInDispatchThread( "Progress", project, comp, TestWriteActionUnderProgress::runIndeterminateProgress); assert success; app.runWriteActionWithCancellableProgressInDispatchThread( "Cancellable progress", project, comp, TestWriteActionUnderProgress::runDeterminateProgress); app.runWriteAction(() -> { Window window = ProgressWindow.calcParentWindow(component, project); PotemkinOverlayProgress progress = new PotemkinOverlayProgress(window); progress.setDelayInMillis(0); ProgressManager.getInstance().runProcess(() -> runIndeterminateProgress(progress), progress); }); }