code: func (w *IndexWriter) nextMerge() *OneMerge {
  	w.Lock() // synchronized
  	defer w.Unlock()
  
  	if w.pendingMerges.Len() == 0 {
  		return nil
  	}
  	// Advance the merge from pending to running
  	merge := w.pendingMerges.Front().Value.(*OneMerge)
  	w.pendingMerges.Remove(w.pendingMerges.Front())
  	w.runningMerges[merge] = true
  	return merge
  }
docs: /*
  Expert: the MergeScheduler calls this method to retrieve the next
  merge requested by the MergePolicy.
  */