Percentile extends AbstractUnivariateStatistic implements Serializable { public void setQuantile(final double p) throws MathIllegalArgumentException { if (p <= 0 || p > 100) { throw new OutOfRangeException( LocalizedFormats.OUT_OF_BOUNDS_QUANTILE_VALUE, p, 0, 100); } quantile = p; } Percentile();  Percentile(final double quantile);  Percentile(final Percentile original); protected  Percentile(final double quantile,
                         final EstimationType estimationType,
                         final NaNStrategy nanStrategy,
                         final KthSelector kthSelector); @Override void setData(final double[] values); @Override void setData(final double[] values, final int begin, final int length); double evaluate(final double p); double evaluate(final double[] values, final double p); @Override double evaluate(final double[] values, final int start, final int length); double evaluate(final double[] values, final int begin,
                           final int length, final double p); double getQuantile(); void setQuantile(final double p); @Override Percentile copy(); @Deprecated static void copy(final Percentile source, final Percentile dest); EstimationType getEstimationType(); Percentile withEstimationType(final EstimationType newEstimationType); NaNStrategy getNaNStrategy(); Percentile withNaNStrategy(final NaNStrategy newNaNStrategy); KthSelector getKthSelector(); PivotingStrategyInterface getPivotingStrategy(); Percentile withKthSelector(final KthSelector newKthSelector);  }
@Test public void testSetQuantile() { final Percentile percentile = new Percentile(10); percentile.setQuantile(100); Assert.assertEquals(100, percentile.getQuantile(), 0); try { percentile.setQuantile(0); Assert.fail("Expecting MathIllegalArgumentException"); } catch (final MathIllegalArgumentException ex) { } try { new Percentile(0); Assert.fail("Expecting MathIllegalArgumentException"); } catch (final MathIllegalArgumentException ex) { } }