void (@Nullable Project key, UiActivity @NotNull ... activities) { UIUtil.dispatchAllInvocationEvents(); BusyObject.Impl busy = (BusyObject.Impl)(key != null ? myMonitor.getBusy(key, activities) : myMonitor.getBusy(activities)); assertTrue("Must be READY, but was: BUSY", busy.isReady()); final boolean[] done = {false}; busy.getReady(this).doWhenDone(() -> done[0] = true); assertTrue(done[0]); }