public static final < T > Set < Set < T > > powerSet ( Set < T > set ) { Set < Set < T >> powerSet = new HashSet <> ( ) ; powerSet . add ( Collections . EMPTY_SET ) ; powerSet ( powerSet , set ) ; return powerSet ; }
Power set of a set A is the set whose members are all possible subsets of A .