code: protected int countEvents(Collection<Event> existingEvents, Event triggeringEvent, DetectionPoint configuredDetectionPoint) {
  		int count = 0;
  
  		long intervalInMillis = configuredDetectionPoint.getThreshold().getInterval().toMillis();
  
  		//grab the startTime to begin counting from based on the current time - interval
  		DateTime startTime = DateUtils.getCurrentTimestamp().minusMillis((int)intervalInMillis);
  
  		//count events after most recent attack.
  		DateTime mostRecentAttackTime = findMostRecentAttackTime(triggeringEvent, configuredDetectionPoint);
  
  		for (Event event : existingEvents) {
  			DateTime eventTimestamp = DateUtils.fromString(event.getTimestamp());
  			//ensure only events that have occurred since the last attack are considered
  			if (eventTimestamp.isAfter(mostRecentAttackTime)) {
  				if (intervalInMillis > 0) {
  					if (DateUtils.fromString(event.getTimestamp()).isAfter(startTime)) {
  						//only increment when event occurs within specified interval
  						count++;
  					}
  				} else {
  					//no interval - all events considered
  					count++;
  				}
  			}
  		}
  
  		return count;
  	}
docs: Count the number of {@link Event}s over a time {@link Interval} specified in milliseconds.
  
  @param existingEvents set of {@link Event}s matching triggering {@link Event} id/user pulled from {@link Event} storage
  @param triggeringEvent the {@link Event} that triggered analysis
  @param configuredDetectionPoint the {@link DetectionPoint} we are currently considering
  @return number of {@link Event}s matching time {@link Interval} and configured {@link DetectionPoint}