MathUtil { public static double iqr(final double[] data) { Arrays.sort(data); int q1 = (int) Math.round(0.25 * (data.length + 1)) - 1; int q3 = (int) Math.round(0.75 * (data.length + 1)) - 1; return data[q3] - data[q1]; }  static double sum(final List<? extends Number> list); static double[] listToArray(final List<? extends Number> list); static double median(final List<Double> list); static double median(final double[] list); static DescriptiveStatistics getStatistics(final List<Double> list); static DescriptiveStatistics getStatistics(final double[] list); static double mean(final List<Double> list); static double variance(final List<Double> list); static double stDev(final List<Double> list); static double mad(final double[] data); static double iqr(final double[] data); static int countNonZeroBeginning(final double[] data); static int countShortestRow(final double[][] data); static double[] trimZeroTail(final double[] data); static double[] getLoessParameterEstimates(final double[] y); static SimpleRegression createLinearRegression(final double[] x,
			final double[] y); static OLSMultipleLinearRegression createLinearRegression(
			final double[][] x, final double[] y); static SimpleRegression createWeigthedLinearRegression(
			final double[] x, final double[] y, final double[] weigths); static double[] getRobustLoessParameterEstimates(final double[] y); static double[] getTricubeWeigts(final int n); static double[] getTricubeBisquareWeigts(final double[] residuals); static double[] abs(final double[] data);  }
@Test public void testIqr() { assertEquals(IQR1, MathUtil.iqr(DATA1), 0); assertEquals(IQR2, MathUtil.iqr(DATA2), 0); }