TaskService taskService = activitiRule.getTaskService();
assertEquals(1, taskService.createTaskQuery().taskCandidateGroup("management").count());
assertEquals(1, taskService.createTaskQuery().taskCandidateGroup("sales").count());
assertEquals(1, taskService.createTaskQuery().taskCandidateGroupIn(Arrays.asList("management")).count());
assertEquals(1, taskService.createTaskQuery().taskCandidateGroupIn(Arrays.asList("management", "sales")).count());
taskService.complete(taskService.createTaskQuery().singleResult().getId());
// Second task is only done by sales
assertEquals(0, taskService.createTaskQuery().taskCandidateGroup("management").count());
assertEquals(1, taskService.createTaskQuery().taskCandidateGroup("sales").count());
assertEquals(0, taskService.createTaskQuery().taskCandidateGroupIn(Arrays.asList("management")).count());