public static <B> Set<List<B>> cartesianProduct(
List<? extends Set<? extends B>> sets) {
CartesianSet<B> cartesianSet = new CartesianSet<B>(sets);
return cartesianSet.isEmpty() ? ImmutableSet.<List<B>>of() : cartesianSet;
}}
public static <B> Set<List<B>> cartesianProduct(
List<? extends Set<? extends B>> sets) {
for (Set<? extends B> set : sets) {
if (set.isEmpty()) {
return ImmutableSet.of();
}
}
CartesianSet<B> cartesianSet = new CartesianSet<B>(sets);
return cartesianSet;
}}