private Task build(T data) {
ITaskFundamentalProperties adapted = adapter.adapt(data);
if (navigator.isMilestone(data)) {
return new Milestone(adapted);
} else if (navigator.isLeaf(data)) {
return new TaskLeaf(adapted);
} else {
return new TaskContainer(adapted,
planner.areContainersExpandedByDefault());
}
}