protected DomainWithTasksWrapper(final ApiContext<AbiquoApi> context, final T target) {
super(context, target);
}
public Iterable<AsyncTask<?, ?>> listTasks() {
TasksDto result = context.getApi().getTaskApi().listTasks(target);
List<AsyncTask<?, ?>> tasks = Lists.newArrayList();
for (TaskDto dto : result.getCollection()) {
tasks.add(newTask(context, dto));
}
// Return the most recent task first
Collections.sort(tasks, new Ordering<AsyncTask<?, ?>>() {