PSquarePercentile extends AbstractStorelessUnivariateStatistic implements StorelessUnivariateStatistic, Serializable { public static PSquareMarkers newMarkers(final List<Double> initialFive, final double p) { return new Markers(initialFive, p); } PSquarePercentile(final double p);   PSquarePercentile(); @Override int hashCode(); @Override boolean equals(Object o); @Override void increment(final double observation); @Override String toString(); long getN(); @Override StorelessUnivariateStatistic copy(); double quantile(); @Override void clear(); @Override double getResult(); static PSquareMarkers newMarkers(final List<Double> initialFive,
            final double p);  }
@Test(expected = MathIllegalArgumentException.class) public void testNullListInMarkers() { PSquarePercentile.newMarkers(null, 0); }
@Test(expected = OutOfRangeException.class) public void testMarkersOORLow() { PSquarePercentile.newMarkers( Arrays.asList(new Double[] { 0.02, 1.18, 9.15, 21.91, 38.62 }), 0.5).estimate(0); }
@Test(expected = OutOfRangeException.class) public void testMarkersOORHigh() { PSquarePercentile.newMarkers( Arrays.asList(new Double[] { 0.02, 1.18, 9.15, 21.91, 38.62 }), 0.5).estimate(5); }
@Test(expected = OutOfRangeException.class) public void testMarkersWithLowerIndex() { PSquareMarkers mThat = PSquarePercentile.newMarkers( Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937, 95.1959, 95.1442, 95.0610, 95.1591, 95.1195, 95.1772, 95.0925, 95.1990, 95.1682 }), 0.50); for (int i = 0; i < testArray.length; i++) { mThat.processDataPoint(testArray[i]); } mThat.estimate(0); }
@Test(expected = OutOfRangeException.class) public void testMarkersWithHigherIndex() { PSquareMarkers mThat = PSquarePercentile.newMarkers( Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937, 95.1959, 95.1442, 95.0610, 95.1591, 95.1195, 95.1772, 95.0925, 95.1990, 95.1682 }), 0.50); for (int i = 0; i < testArray.length; i++) { mThat.processDataPoint(testArray[i]); } mThat.estimate(6); }
@Test(expected = OutOfRangeException.class) public void testMarkerHeightWithLowerIndex() { PSquareMarkers mThat = PSquarePercentile.newMarkers( Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937, 95.1959, 95.1442, 95.0610, 95.1591, 95.1195, 95.1772, 95.0925, 95.1990, 95.1682 }), 0.50); mThat.height(0); }
@Test(expected = OutOfRangeException.class) public void testMarkerHeightWithHigherIndex() { PSquareMarkers mThat = PSquarePercentile.newMarkers( Arrays.asList(new Double[] { 95.1772, 95.1567, 95.1937, 95.1959, 95.1442, 95.0610, 95.1591, 95.1195, 95.1772, 95.0925, 95.1990, 95.1682 }), 0.50); mThat.height(6); }
@Test(expected = MathIllegalArgumentException.class) public void testInitial() { PSquarePercentile.newMarkers(new ArrayList<Double>(), 0.5); Assert.fail(); }