@Override public void beginWindow(long windowId){
  currentCursor=(currentCursor + 1) % windowSize;
  lastExpiredWindowState=states.get(currentCursor);
  states.set(currentCursor,createWindowState());
}

@ Override public void beginWindow ( long windowId ) { currentCursor = ( currentCursor + 1 ) % windowSize ; lastExpiredWindowState = states . get ( currentCursor ) ; states . set ( currentCursor , createWindowState ( ) ) ; }
moves states by 1 and sets current state to null . if you override beginwindow , you must call super . beginwindow ( windowid ) to ensure proper operator behavior .
