void () { final LocalTask defaultTask = myTaskManager.getLocalTasks().get(0); Task task = myRepository.findTask("TEST-001"); assertNotNull(task); runOpenTaskDialog(task); assertEquals(2, myTaskManager.getLocalTasks().size()); LocalTask localTask = myTaskManager.getActiveTask(); assertEquals(task, localTask); assertEquals(1, localTask.getChangeLists().size()); assertEquals(1, defaultTask.getChangeLists().size()); assertEquals(2, myChangeListManager.getChangeLists().size()); assertEquals(localTask, myTaskManager.getAssociatedTask(myChangeListManager.getChangeLists().get(0))); myTaskManager.activateTask(defaultTask, false); assertEquals(1, localTask.getChangeLists().size()); assertEquals(1, defaultTask.getChangeLists().size()); assertEquals(2, myChangeListManager.getChangeLists().size()); assertEquals(defaultTask, myTaskManager.getAssociatedTask(myChangeListManager.getChangeLists().get(0))); myTaskManager.activateTask(localTask, false); assertEquals(1, localTask.getChangeLists().size()); assertEquals(1, defaultTask.getChangeLists().size()); assertEquals(2, myChangeListManager.getChangeLists().size()); LocalChangeList activeChangeList = myChangeListManager.getDefaultChangeList(); LocalChangeList anotherChangeList = myChangeListManager.getChangeLists() .get(1 - myChangeListManager.getChangeLists().indexOf(activeChangeList)); assertNotNull(activeChangeList); assertEquals(localTask, myTaskManager.getAssociatedTask(activeChangeList)); assertEquals("TEST-001 Summary", activeChangeList.getName()); assertEquals(defaultTask, myTaskManager.getAssociatedTask(anotherChangeList)); assertEquals(LocalChangeList.getDefaultName(), anotherChangeList.getName()); myTaskManager.activateTask(defaultTask, false); myChangeListManager.waitUntilRefreshed(); assertEquals(1, localTask.getChangeLists().size()); assertEquals(1, defaultTask.getChangeLists().size()); assertEquals(2, myChangeListManager.getChangeLists().size()); activeChangeList = myChangeListManager.getDefaultChangeList(); anotherChangeList = myChangeListManager.getChangeLists().get(1 - myChangeListManager.getChangeLists().indexOf(activeChangeList)); assertNotNull(activeChangeList); assertEquals(defaultTask, myTaskManager.getAssociatedTask(activeChangeList)); assertEquals(LocalChangeList.getDefaultName(), activeChangeList.getName()); assertEquals(localTask, myTaskManager.getAssociatedTask(anotherChangeList)); assertEquals("TEST-001 Summary", anotherChangeList.getName()); }