code: protected LinkedList<Notification> getNotifications(Event triggerEvent, Rule rule) {
  		LinkedList<Notification> notificationQueue = new LinkedList<Notification>();
  		Collection<Event> events = getApplicableEvents(triggerEvent, rule);
  		Collection<DetectionPoint> detectionPoints = rule.getAllDetectionPoints();
  
  		for (DetectionPoint detectionPoint : detectionPoints) {
  			Queue<Event> eventQueue = new LinkedList<Event>();
  
  			for (Event event : events) {
  				if (event.getDetectionPoint().typeAndThresholdMatches(detectionPoint)) {
  					eventQueue.add(event);
  
  					if (isThresholdViolated(eventQueue, event, detectionPoint.getThreshold())) {
  						int queueDuration = (int)getQueueInterval(eventQueue, event).toMillis();
  						DateTime start = DateUtils.fromString(eventQueue.peek().getTimestamp());
  
  						Notification notification = new Notification(queueDuration, "milliseconds", start, detectionPoint);
  						notificationQueue.add(notification);
  					}
  
  					if (eventQueue.size() >= detectionPoint.getThreshold().getCount()) {
  						eventQueue.poll();
  					}
  				}
  			}
  		}
  
  		Collections.sort(notificationQueue, Notification.getEndTimeAscendingComparator());
  
  		return notificationQueue;
  	}
docs: Builds a queue of all {@link Notification}s from the events relating to the
  current {@link Rule}. The {@link Notification}s are ordered in the Queue by
  start time.
  
  @param triggerEvent the {@link Event} that triggered analysis
  @param rule the {@link Rule} being evaluated
  @return a queue of {@link TriggerEvents}