Java:
public void generatePermutations(ArrayList<String>... lists){
ArrayList<ArrayList<String>> ll = new ArrayList<>();
Collections.addAll(ll, lists);
result = new ArrayList<>();
generatePermutations(ll, this.result, 0, "");
}
@the living tribunal