tests for merge and join operation