for (Deadline deadline : deadlines) {
if (!deadline.isEscalated()) {
// only escalate when true - typically this would only be true
// if the user is requested that the notification should never be escalated
Date date = deadline.getDate();
service.schedule(new ScheduledTaskDeadline(taskId, deadline.getId(), service), date.getTime() - now);
}
}
}