private void clearUp(){
  long limit=System.currentTimeMillis() - interval;
  while (!data.isEmpty() && data.getLast() < limit) {
    data.removeLast();
  }
}

private void clearUp ( ) { long limit = System . currentTimeMillis ( ) - interval ; while ( ! data . isEmpty ( ) && data . getLast ( ) < limit ) { data . removeLast ( ) ; } }
removes old elements that are no longer in the time window .
