A cartesian product returns every possible combination of two collections. In the instance of set A and B, the cartesian product is A X B. You can look at it as list multiplication. In the snippet below, we will use guava Sets.cartesianProduct to return every possible list that be formed by multiplying all the elements.