void () { TestTask task = new TestTask().withAssertion(() -> ApplicationManager.getApplication().isWriteIntentLockAcquired()); ProgressResult<?> result = computeAssertingExceptionConditionally( myOnEdt && myReleaseIWLockOnRun, () -> new ProgressRunner<>(task) .onThread(ProgressRunner.ThreadToUse.WRITE) .withProgress(createProgressWindow()) .modal() .sync() .submitAndGet()); if (result == null) return; assertFalse(result.isCanceled()); assertNull(result.getThrowable()); task.assertFinished(); }