public static void dumpLastAndStop(int n){
  ConcurrentLinkedQueue<Item> q=que.getAndSet(null);
  if (q == null)   return;
  int size=q.size();
  while (size-- > n)   q.poll();
  dump(q);
}

public static void dumpLastAndStop ( int n ) { ConcurrentLinkedQueue < Item > q = que . getAndSet ( null ) ; if ( q == null ) return ; int size = q . size ( ) ; while ( size -- > n ) q . poll ( ) ; dump ( q ) ; }
dumps given number of last events .
