void () { final ProgressIndicator progress = new ProgressIndicatorBase(){ @Override protected boolean isCancelable() { return true; } }; assertThrows(ProcessCanceledException.class, () -> ProgressManager.getInstance().executeProcessUnderProgress(() -> { assertFalse(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); assertFalse(progress.isCanceled()); progress.cancel(); assertTrue(CoreProgressManager.threadsUnderCanceledIndicator.contains(Thread.currentThread())); assertTrue(progress.isCanceled()); waitForPCE(); }, ProgressWrapper.wrap(progress)) ); }