title: Java: Generate a Powerset
body: <p>This could be language agnostic/helpful answers could just be in pseudo-code.</p>
  
  <p>I have a program that I would like to test under a range of inputs. This program takes a set of files, one of which is designated as the root. I want to run the program with all possible subsets of files. (Two subsets, containing the same files, but with different roots, are considered to be different.)</p>
  
  <p>Here's a same example. Say I have files A, B, and C. I would want to test with:</p>
  
  <pre><code>{A}, root = A
  {B}, root = B
  {C}, root = C
  {A B}, root = A
  {A B}, root = B
  {B C}, root = B
  {B C}, root = C
  {A C}, root = A
  {A C}, root = C
  {A B C}, root = A
  {A B C}, root = B
  {A B C}, root = C
  </code></pre>
  
  <p>and so on. I believe this would be the powerset.</p>
  
  <p>What is the best way to generate this set in Java, given a directory full of files?</p>