I am writing my own java api library (for personal use) and need to specific code generation combinations. For example: if the possible values are A,B,C,D,E I need the result to be as listed below (in this order, no duplciates). Recusion is fine, I have been update to generate this so far myself and online searches have provided no good help. I am not going to store this in memory just print the results to a file, so I don't need a running list of current combinations as I am also trying to keep memory to a minimum as it runs -> thus for now output to System.out is fine to make progress on the algorithm itself

example output:
A,
B,
C,
D,
E
A,B
A,C
A,D
A,E
B,C
B,D
B,E
C,D
C,E
A,B,C
A,B,D
A,B,E
A,C,D
A,C,E
A,D,E
B,C,D
B,D,E
C,D,E
A,B,C,D
A,B,C,E
A,C,D,E
B,C,D,E
A,B,C,D,E

Is this possible? has anyone seen this done before?