StatUtils { public static double sumLog(final double[] values) throws MathIllegalArgumentException { return SUM_OF_LOGS.evaluate(values); } private  StatUtils(); static double sum(final double[] values); static double sum(final double[] values, final int begin,
            final int length); static double sumSq(final double[] values); static double sumSq(final double[] values, final int begin,
            final int length); static double product(final double[] values); static double product(final double[] values, final int begin,
            final int length); static double sumLog(final double[] values); static double sumLog(final double[] values, final int begin,
            final int length); static double mean(final double[] values); static double mean(final double[] values, final int begin,
            final int length); static double geometricMean(final double[] values); static double geometricMean(final double[] values, final int begin,
            final int length); static double variance(final double[] values); static double variance(final double[] values, final int begin,
            final int length); static double variance(final double[] values, final double mean,
            final int begin, final int length); static double variance(final double[] values, final double mean); static double populationVariance(final double[] values); static double populationVariance(final double[] values, final int begin,
            final int length); static double populationVariance(final double[] values, final double mean,
            final int begin, final int length); static double populationVariance(final double[] values, final double mean); static double max(final double[] values); static double max(final double[] values, final int begin,
            final int length); static double min(final double[] values); static double min(final double[] values, final int begin,
            final int length); static double percentile(final double[] values, final double p); static double percentile(final double[] values, final int begin,
            final int length, final double p); static double sumDifference(final double[] sample1, final double[] sample2); static double meanDifference(final double[] sample1, final double[] sample2); static double varianceDifference(final double[] sample1,
            final double[] sample2, double meanDifference); static double[] normalize(final double[] sample); static double[] mode(double[] sample); static double[] mode(double[] sample, final int begin, final int length);  }
@Test public void testSumLog() { double[] x = null; try { StatUtils.sumLog(x); Assert.fail("null is not a valid data array."); } catch (MathIllegalArgumentException ex) { } try { StatUtils.sumLog(x, 0, 4); Assert.fail("null is not a valid data array."); } catch (MathIllegalArgumentException ex) { } x = new double[] {}; TestUtils.assertEquals(0, StatUtils.sumLog(x), TOLERANCE); TestUtils.assertEquals(0, StatUtils.sumLog(x, 0, 0), TOLERANCE); x = new double[] {TWO}; TestUtils.assertEquals(FastMath.log(TWO), StatUtils.sumLog(x), TOLERANCE); TestUtils.assertEquals(FastMath.log(TWO), StatUtils.sumLog(x, 0, 1), TOLERANCE); x = new double[] {ONE, TWO, TWO, THREE}; TestUtils.assertEquals(FastMath.log(ONE) + 2.0 * FastMath.log(TWO) + FastMath.log(THREE), StatUtils.sumLog(x), TOLERANCE); TestUtils.assertEquals(2.0 * FastMath.log(TWO), StatUtils.sumLog(x, 1, 2), TOLERANCE); }