### Question:
FunctionUtils { public static int[] fromTensorIndex(int index, int[] dimensions) { ArgChecker.notNull(dimensions, "dimensions"); int dim = dimensions.length; int[] res = new int[dim]; int product = 1; int[] products = new int[dim - 1]; for (int i = 0; i < dim - 1; i++) { product *= dimensions[i]; products[i] = product; } int a = index; for (int i = dim - 1; i > 0; i--) { res[i] = a / products[i - 1]; a -= res[i] * products[i - 1]; } res[0] = a; return res; } private  FunctionUtils(); @Deprecated static double square(double x); @Deprecated static double cube(double x); static int toTensorIndex(int[] indices, int[] dimensions); static int[] fromTensorIndex(int index, int[] dimensions); static double[] unique(double[] in); static int[] unique(int[] in); static int getLowerBoundIndex(DoubleArray set, double value);  }### Answer:
@Test public void testNullDimensions2() { assertThatIllegalArgumentException() .isThrownBy(() -> FunctionUtils.fromTensorIndex(2, null)); }