TaskElement task) {
TaskMilestone milestone = TaskMilestone.create(task.getEndDate());
milestone.setName(_("new milestone"));
taskElementDAO.reattach(task);
Position taskPosition = context.getMapper().findPositionFor(task);
int insertAt = taskPosition.getInsertionPosition() + 1;
TaskGroup parent = task.getParent();
parent.addTaskElement(insertAt, milestone);
context.add(taskPosition.sameLevelAt(insertAt), milestone);
}