This could be language agnostic/helpful answers could just be in pseudo-code.
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.)
Here's a same example. Say I have files A, B, and C. I would want to test with:
{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
and so on. I believe this would be the powerset.
What is the best way to generate this set in Java, given a directory full of files?