void () { assertReady(null); MockProject project1 = new MockProjectEx(getTestRootDisposable()); assertReady(project1); MockProject project2 = new MockProjectEx(getTestRootDisposable()); assertReady(project2); myMonitor.initBusyObjectFor(project1); assertTrue(myMonitor.hasObjectFor(project1)); myMonitor.initBusyObjectFor(project2); assertTrue(myMonitor.hasObjectFor(project2)); myMonitor.addActivity(new UiActivity("global"), ModalityState.any()); assertBusy(null); assertBusy(project1); assertBusy(project2); myMonitor.addActivity(new UiActivity("global"), ModalityState.any()); assertBusy(null); assertBusy(project1); assertBusy(project2); myMonitor.removeActivity(new UiActivity("global")); assertReady(null); assertReady(project1); assertReady(project2); myMonitor.addActivity(project1, new UiActivity("p1"), ModalityState.any()); assertReady(null); assertBusy(project1); assertReady(project2); myMonitor.addActivity(new UiActivity("global"), ModalityState.any()); assertBusy(null); assertBusy(project1); assertBusy(project2); myMonitor.removeActivity(new UiActivity("global")); assertReady(null); assertBusy(project1); assertReady(project2); myMonitor.removeActivity(project1, new UiActivity("p1")); assertReady(null); assertReady(project1); assertReady(project2); }