TaskModel { public Task create(Client client) { return taskManager.create(client); } TaskModel(ClientModel clientModel, TaskManager taskManager); @Handler void selectedClientChanged(SelectedClientChangedEvent event); void subscribe(Object listener); void unsubscribe(Object listener); Task getSelectedTask(); void selectTask(Task newTask); Task create(Client client); int count(); int countUnfinished(); Task get(int index); List<Task> getForClient(Client client, boolean unfinishedOnly); void save(Task task); void delete(Task task); Task getWorkingTask(); void startWork(Task task); void stopWork();  }
@Test public void testCreate() throws Exception { assertEquals(2, taskManager.tasks.size()); Task task = model.create(client); assertEquals(client, task.getClient()); assertEquals(0, events.size()); assertEquals(2, taskManager.tasks.size()); }