code: protected ArrayList<Event> getApplicableEvents(Event triggerEvent, Rule rule) {
  		ArrayList<Event> events = new ArrayList<Event>();
  
  		DateTime ruleStartTime = DateUtils.fromString(triggerEvent.getTimestamp()).minus(rule.getWindow().toMillis());
  		DateTime lastAttackTime = findMostRecentAttackTime(triggerEvent, rule);
  		DateTime earliest = ruleStartTime.isAfter(lastAttackTime) ? ruleStartTime : lastAttackTime;
  
  		SearchCriteria criteria = new SearchCriteria().
  				setUser(triggerEvent.getUser()).
  				setEarliest(earliest.plus(1).toString()).
  				setRule(rule).
  				setDetectionSystemIds(appSensorServer.getConfiguration().getRelatedDetectionSystems(triggerEvent.getDetectionSystem()));
  
  		events = (ArrayList<Event>)appSensorServer.getEventStore().findEvents(criteria);
  
  		Collections.sort(events, Event.getTimeAscendingComparator());
  
  		return events;
  	}
docs: Finds all {@link Event}s related to the {@link Rule} being evaluated.
  
  @param triggerEvent the {@link Event} that triggered the {@link Rule}
  @param rule the {@link Rule} being evaluated
  @return a list of {@link Event}s applicable to the {@link Rule}