@Test public void testCalculateMean_Array() { try { Statistics.calculateMean((Number[]) null); fail("IllegalArgumentException should have been thrown on null key"); } catch (IllegalArgumentException e) { assertEquals("Null 'values' argument.", e.getMessage()); } try { Statistics.calculateMean((Number[]) null, false); fail("IllegalArgumentException should have been thrown on negative key"); } catch (IllegalArgumentException e) { assertEquals("Null 'values' argument.", e.getMessage()); } assertTrue(Double.isNaN(Statistics.calculateMean(new Number[0]))); assertTrue(Double.isNaN(Statistics.calculateMean(new Number[0], false))); Number[] values = new Number[] {1.0}; assertEquals(1.0, Statistics.calculateMean(values), EPSILON); assertEquals(1.0, Statistics.calculateMean(values, true), EPSILON); assertEquals(1.0, Statistics.calculateMean(values, false), EPSILON); values = new Number[] {1.0, null}; assertTrue(Double.isNaN(Statistics.calculateMean(values))); assertTrue(Double.isNaN(Statistics.calculateMean(values, true))); assertEquals(1.0, Statistics.calculateMean(values, false), EPSILON); values = new Number[] {1.0, Double.NaN}; assertTrue(Double.isNaN(Statistics.calculateMean(values))); assertTrue(Double.isNaN(Statistics.calculateMean(values, true))); assertEquals(1.0, Statistics.calculateMean(values, false), EPSILON); }
public static double calculateMean(Number[] values) { return calculateMean(values, true); }
Statistics { public static double calculateMean(Number[] values) { return calculateMean(values, true); } }
Statistics { public static double calculateMean(Number[] values) { return calculateMean(values, true); }  }
Statistics { public static double calculateMean(Number[] values) { return calculateMean(values, true); }  static double calculateMean(Number[] values); static double calculateMean(Number[] values,
            boolean includeNullAndNaN); static double calculateMean(Collection<Number> values); static double calculateMean(Collection<Number> values,
            boolean includeNullAndNaN); static double calculateMedian(List<Number> values); static double calculateMedian(List<Number> values,
            boolean copyAndSort); static double calculateMedian(List<Number> values, int start, int end); static double calculateMedian(List<Number> values,
            int start, int end, boolean copyAndSort); static double getStdDev(Number[] data); static double[] getLinearFit(Number[] xData, Number[] yData); static double getSlope(Number[] xData, Number[] yData); static double getCorrelation(Number[] data1, Number[] data2); static double[][] getMovingAverage(Number[] xData,
                                              Number[] yData,
                                              int period); }
Statistics { public static double calculateMean(Number[] values) { return calculateMean(values, true); }  static double calculateMean(Number[] values); static double calculateMean(Number[] values,
            boolean includeNullAndNaN); static double calculateMean(Collection<Number> values); static double calculateMean(Collection<Number> values,
            boolean includeNullAndNaN); static double calculateMedian(List<Number> values); static double calculateMedian(List<Number> values,
            boolean copyAndSort); static double calculateMedian(List<Number> values, int start, int end); static double calculateMedian(List<Number> values,
            int start, int end, boolean copyAndSort); static double getStdDev(Number[] data); static double[] getLinearFit(Number[] xData, Number[] yData); static double getSlope(Number[] xData, Number[] yData); static double getCorrelation(Number[] data1, Number[] data2); static double[][] getMovingAverage(Number[] xData,
                                              Number[] yData,
                                              int period);  }