I have a number of ArrayList with each ArrayList having objects and each one can have different length. I need to generate permutation like in the
ArrayList
Lists.cartesianProduct(List...)
E.g.:
List list1 = Arrays.asList("a", "b", "c"); List list2 = Arrays.asList("d", "e"); System.out.println(Lists.cartesianProduct(list1, list2));
Output:
[[a, d], [a, e], [b, d], [b, e], [c, d], [c, e]]