/** Removes the task. */
 public void remove() {
   startTask.cancel();
   endTask.cancel();
   calendarService.removeFromTaskMap(id);
   calendarService.removeFromCurrentItems(this);
   calendarService.updateStateFromCurrentItems();
 }
 /** This method is executed in the end of the calendar item. */
 protected void stop() {
   calendarService.removeFromTaskMap(id);
   calendarService.removeFromCurrentItems(this);
   calendarService.updateStateFromCurrentItems();
   if (pattern != null) {
     CalendarItemTimerTask nextTask = pattern.next(startDate, endDate);
     this.pattern = null;
     nextTask.scheduleTasks();
   }
 }