Code for testing sort, intersect, and union operations