title: Java permutation & combination with sublist without order
body: <p>I'm trying to solve the following problem in Java:</p>
  
  <p>I have a list of 12 'Person' objects (but let's represent them by integers to simplify calculations) of which I want to create all possible unique combinations. I found enough snippets online to help me with that (I used <a href="http://www.dzone.com/snippets/java-program-doing-permutation" rel="nofollow">this</a> one so far), but here's the part I can 't figure out:</p>
  
  <p>The list is divided in 4 sublists of variable length in which the order should not matter. These lengths are defined in an int array, e.g. {3,4,2,3}.</p>
  
  <p>In the given example the original list could look like this:</p>
  
  <p><code>{ 1,2,3,  4,5,6,7,  8,9,  10,11,12 }</code></p>
  
  <p>Where this one would be the same so it should not be calculated:</p>
  
  <p><code>{ 3,2,1,  7,6,5,4,  9,8,  12,11,10 }</code></p>
  
  <p>I only want to calculate one because first calculating every combination and then sorting all sublists to then compare all lists would of course be very unperformant.</p>
  
  <p>PS: I could'nt find a better title than this, which is why I didn't succeed at googling the problem either. Suggestions would be appreciated :-)</p>