Unit testing for pair index calculation