title: Java Combination Generation
body: <p>I'm looking to see if java has some combinatorics features that I can utilize. I want to have a dynamic list, and in a clean way, have java generate all combinations.</p>
  
  <p>Given a list of objects, such as strings below. Is there an easy way/clean way/preferably something already built into core java to generate all combinations of the items? e.g. If I had:</p>
  
  <pre><code>List&lt;String&gt; items = new ArrayList&lt;String&gt;();
  items.add("a");
  items.add("b");
  List&lt;List&lt;String&gt;&gt; result = generateCombinationOf(items);
  </code></pre>
  
  <p>I desire for results to contain: <code>{{}, {"a"}, {"b"}, {"a", "b"}}</code></p>
  
  <p><strong>Side note:</strong> I was able to generate lists like this in mathematica in the past. I have a side project where I want to utilize java and I'm hoping to avoid integrating with mathematica if at all possible, but will if I can't find some features like the above easily available.</p>