Add test cases for cartesian product