Utils { public static int argmin(double[] a) { int imin = 0; for (int i=1; i<a.length; i++) if (a[i] < a[imin]) imin = i; return imin; }  static double median(ArrayList<Double> arrList); static double mean(double[] x); static double[] interp(double[] x, double[] xp, double[] yp); static double stdev(double[] a); static double[] extract(int[] indicator, int value, double[] arr); static String array2string(double[] a, String format); static int argmax(double[] a); static int argmin(double[] a); static double findBestShift(double[] laserT, double[] touchT, double[] touchY);  }
@Test public void testArgmin() { assertThat(Utils.argmin(new double[]{5, 2, 1, -10, -20, 5, 19, 100}), is(4)); }
@Test public void testArgmin_empty() { assertThat(Utils.argmin(new double[]{}), is(0)); }