code: @Override
    public void setNextPageID(int next_page_id) {
      this.nextPageID = next_page_id;
      while(!emptyPages.isEmpty() && emptyPages.peek() >= this.nextPageID) {
        emptyPages.pop();
      }
    }
docs: Set the next page id to the given value. If this means that any page ids
  stored in <code>emptyPages</code> are smaller than
  <code>next_page_id</code>, they are removed from this file's observation
  stack.
  
  @param next_page_id the id of the next page to be inserted (if there are no
  more empty pages to be filled)