@Test public void testCalculateMedian() { assertTrue(Double.isNaN(Statistics.calculateMedian(null, false))); assertTrue(Double.isNaN(Statistics.calculateMedian(null, true))); List <Number>list = new ArrayList<Number>(); assertTrue(Double.isNaN(Statistics.calculateMedian(list, false))); assertTrue(Double.isNaN(Statistics.calculateMedian(list, true))); list.add(null); try { Statistics.calculateMedian(list, false); fail("Should have thrown a NullPointerException"); } catch (NullPointerException e) { } try { Statistics.calculateMedian(list, true); fail("Should have thrown a NullPointerException"); } catch (NullPointerException e) { } }
public static double calculateMedian(List<Number> values) { return calculateMedian(values, true); }
Statistics { public static double calculateMedian(List<Number> values) { return calculateMedian(values, true); } }
Statistics { public static double calculateMedian(List<Number> values) { return calculateMedian(values, true); }  }
Statistics { public static double calculateMedian(List<Number> values) { return calculateMedian(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 calculateMedian(List<Number> values) { return calculateMedian(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);  }