title: Cartesian product of an arbitrary number of sets
body: <p>Do you know some neat Java libaries that allow you to make cartesian product of two (or more) sets? </p>
  
  <p>For example: I have three sets. One with objects of class Person, second with objects of class Gift and third with objects of class GiftExtension.</p>
  
  <p>I want to generate one set containing all possible triples Person-Gift-GiftExtension.</p>
  
  <p>The number of sets might vary so I cannot do this in nested foreach loop. 
  Under some conditions my application needs to make a product of Person-Gift pair, sometimes it is triple Person-Gift-GiftExtension, sometimes there might even be sets Person-Gift-GiftExtension-GiftSecondExtension-GiftThirdExtension, etc. </p>