### Question:
PermutationUtils { public static int numPermutations(List<Integer> binSizes) { List<Integer> maxValues = new ArrayList<>(); boolean positive = false; for(Integer binSize : binSizes) { int size = binSize - 1; if(size < 0) { size = 0; } else { positive = true; } maxValues.add(size); } int result = toPermutation(maxValues, binSizes); if(positive && !maxValues.isEmpty()) { result++; } return result; }  static List<Integer> fromPermutation(int permutation, List<Integer> binSizes); static int toPermutation(List<Integer> values, List<Integer> binSizes); static int numPermutations(List<Integer> binSizes);  }### Answer:
@Test public void testNumPermutations() { int index = numPermutations(bins); Assert.assertEquals(index, this.index); }