// get all tasks from database
Set<Task> tasks = service.getAllTasks();
Iterator<Task> iterator = tasks.iterator();
while (iterator.hasNext()) {
Task task = iterator.next();
service.removeTask(task.getId());
}
// check if there are not any tasks there
tasks = service.getAllTasks();
assertEquals(0, tasks.size());