public void recordNewEvent ( ) { // Remove old events from record final double thresholdTime = System . currentTimeMillis ( ) - ( timeslotInMilliseconds * 2.0 ) ; events . removeIf ( e -> e < thresholdTime ) ; // Record new event events . add ( System . currentTimeMillis ( ) ) ; }
Record a new event