### Question:
Arrays { public static <T> Array<T> reduce(Array<T> org) { IndexFn ri = org.indexFn().reduce(); if (ri == org.indexFn()) return org; return org.createView(ri); }  static Array<T> factory(DataType dataType, int[] shape, Storage<T> storage); static Array<T> factory(DataType dataType, int[] shape, Object dataArray); static Array<T> factory(DataType dataType, int[] shape); static Array<T> factoryCopy(DataType dataType, int[] shape, List<Array<T>> dataArrays); static Array<T> factoryArrays(DataType dataType, int[] shape, List<Array<?>> dataArrays); static Array<T> flip(Array<T> org, int dim); static Array<T> permute(Array<T> org, int[] dims); static Array<T> reshape(Array<T> org, int[] shape); static Array<T> reduce(Array<T> org); static Array<T> reduce(Array<T> org, int dim); static Array<T> section(Array<T> org, List<Range> ranges); static Array<T> slice(Array<T> org, int dim, int value); static Array<T> transpose(Array<T> org, int dim1, int dim2); static long computeSize(int[] shape); static boolean isVariableLength(int[] shape); static int[] removeVlen(int[] shape);  }### Answer:
@Test public void testReduce() { Array<Double> rArray = Arrays.reduce(array); assertThat(rArray.getShape()).isEqualTo(new int[] {2, 3}); int[] reshape = new int[] {3, 2, 1}; Array<Double> pArray = Arrays.reshape(array, reshape); rArray = Arrays.reduce(pArray); assertThat(rArray.getShape()).isEqualTo(new int[] {3, 2}); }