Product extends AbstractStorelessUnivariateStatistic implements Serializable, WeightedEvaluation { @Override public double evaluate(final double[] values, final int begin, final int length) throws MathIllegalArgumentException { double product = Double.NaN; if (test(values, begin, length, true)) { product = 1.0; for (int i = begin; i < begin + length; i++) { product *= values[i]; } } return product; } Product();  Product(Product original); @Override void increment(final double d); @Override double getResult(); long getN(); @Override void clear(); @Override double evaluate(final double[] values, final int begin, final int length); double evaluate(final double[] values, final double[] weights,
        final int begin, final int length); double evaluate(final double[] values, final double[] weights); @Override Product copy(); static void copy(Product source, Product dest);  }
@Test public void testWeightedProduct() { Product product = new Product(); Assert.assertEquals(expectedWeightedValue(), product.evaluate(testArray, testWeightsArray, 0, testArray.length),getTolerance()); Assert.assertEquals(expectedValue(), product.evaluate(testArray, unitWeightsArray, 0, testArray.length), getTolerance()); }