code: func (fs *FileSet) MustReplace(oldFiles []File, newFile File) *FileSet {
  	assert(len(oldFiles) > 0, "cannot replace empty files")
  
  	// Find index of first old file.
  	var i int
  	for ; i < len(fs.files); i++ {
  		if fs.files[i] == oldFiles[0] {
  			break
  		} else if i == len(fs.files)-1 {
  			panic("first replacement file not found")
  		}
  	}
  
  	// Ensure all old files are contiguous.
  	for j := range oldFiles {
  		if fs.files[i+j] != oldFiles[j] {
  			panic(fmt.Sprintf("cannot replace non-contiguous files: subset=%+v, fileset=%+v", Files(oldFiles).IDs(), Files(fs.files).IDs()))
  		}
  	}
  
  	// Copy to new fileset.
  	other := make([]File, len(fs.files)-len(oldFiles)+1)
  	copy(other[:i], fs.files[:i])
  	other[i] = newFile
  	copy(other[i+1:], fs.files[i+len(oldFiles):])
  
  	// Build new fileset and rebuild changed filters.
  	return &FileSet{
  		levels: fs.levels,
  		files:  other,
  	}
  }
docs: // MustReplace swaps a list of files for a single file and returns a new file set.
  // The caller should always guarantee that the files exist and are contiguous.