adding a method to help set mate cigars and mate information given a

queryname sorted iterator.  This is useful when we want to fix or update
the mate information, including the mate cigar.
It seems both places this is called, it is within a while loop over the iterator. The iterator itself is passed in to this function. Wouldn't it be much clearer to have the while loop wholly contained in this method?

If I read this right, the behavior of this function is to set mate info for all alignments of the /next/ read of the iterator. But the method is also implicitly updating /next/. You have to call it within a loop to set mate info for all alignments of all reads in the iterator (which is how both calling classes use it). And the outer loop must /not/ call next(). This feels confusing to me.

If you moved the while loop into this function, the return value would be the total number of mateCigar tags added, rather than the number added per read. But you are performing this summation anyway in RevertOriginalBaseQualitiesAndAddMateCigar

Moving the while loop inside this method would necessitate changing the unit test to match