public long getNumberOfEventsInTimeslot ( ) { final double thresholdTime = System . currentTimeMillis ( ) - ( timeslotInMilliseconds ) ; return events . stream ( ) . filter ( e -> e >= thresholdTime ) . count ( ) ; }
Get the number of events in the timeslot