Permutation { public List<List<String>> allChoices(List<String[]> categories) { List<List<String>> choices = new ArrayList<>(); int[] indices = new int[categories.size()]; allChoices(categories, choices, indices); return choices; }  static List<List<T>> insertPermutateNoDup(T[] array); static List<List<T>> recursivePermutateNoDup(T[] array); static void recursivePermutateNoDup(T[] array, int start, List<List<T>> cache); static List<List<T>> permuteDup(T[] array); List<List<String>> allChoices(List<String[]> categories);  }
@Test(dataProvider = "choices") public void testAllChoices(List<String[]> categories, List<List<String>> expected) { TestUtilities.assertEquals(new Permutation().allChoices(categories), expected); }