* test for task inclusion/exclusion when additional filter is specified (like assignee), no order.
*/
public void testQueryByAssigneeExcludeSubtasksPaginated() throws Exception {
// gonzo has 2 root tasks and 3+2 subtasks assigned
// include subtasks
TaskQuery query = taskService.createTaskQuery().taskAssignee("gonzo");
assertEquals(7, query.count());
assertEquals(2, query.listPage(0, 2).size());
// exclude subtasks
query = taskService.createTaskQuery().taskAssignee("gonzo").excludeSubtasks();
assertEquals(2, query.count());
assertEquals(1, query.listPage(0, 1).size());
// kermit has no root tasks and no subtasks assigned
// include subtasks
query = taskService.createTaskQuery().taskAssignee("kermit");
assertEquals(0, query.count());
assertEquals(0, query.listPage(0, 2).size());
assertNull(query.singleResult());
// exclude subtasks
query = taskService.createTaskQuery().taskAssignee("kermit").excludeSubtasks();
assertEquals(0, query.count());
assertEquals(0, query.listPage(0, 2).size());
assertNull(query.singleResult());
}