void () { ProgressIndicator indicator = new DaemonProgressIndicator(); for (int i=0;i<10000;i++) { indicator = new SensitiveProgressWrapper(indicator); } ProgressManager.getInstance().executeProcessUnderProgress(() -> { ProgressIndicator progressIndicator = ProgressIndicatorProvider.getGlobalProgressIndicator(); assertTrue(progressIndicator instanceof SensitiveProgressWrapper); progressIndicator.checkCanceled(); progressIndicator.isCanceled(); }, indicator); }