void () { final UiActivity root = new UiActivity("root"); final UiActivity op1 = new UiActivity("root", "operation1"); final UiActivity op2 = new UiActivity("root", "operation2"); final UiActivity op12 = new UiActivity("root", "operation1", "operation12"); final UiActivity op121 = new UiActivity("root", "operation1", "operation12", "operation121"); myMonitor.addActivity(op1); assertBusy(null); assertReady(null, op2); assertBusy(null, op1); assertBusy(null, root); myMonitor.removeActivity(op1); assertReady(null); assertReady(null, op2); assertReady(null, op1); assertReady(null, root); myMonitor.addActivity(op12); assertBusy(null); assertBusy(null, root); assertBusy(null, op12); assertReady(null, op121); }