Percentile { public static Percentile createStrict(double percentile) { if (MIN_PERCENTILE > percentile || MAX_PERCENTILE < percentile) { throw new IllegalArgumentException("The 'percentile' must be in the range (0, 100]."); } if (getNumDecimalPlaces(percentile) > 2) { throw new IllegalArgumentException("The 'percentile' has over two decimal places."); } return new Percentile(percentile); } private  Percentile(double percentile); Double asDouble(); static Percentile createStrict(double percentile); static Percentile createStrict(Number percentile); static Percentile createCoerced(double percentile); static Percentile createCoerced(Number percentile); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test(expected = IllegalArgumentException.class) public void testPercentile_TooManyDecimalPlaces() { Percentile.createStrict(0.00 + Double.MIN_VALUE); }
@Test(expected = IllegalArgumentException.class) public void testPercentile_TooManyDecimalPlaces2() { Percentile.createStrict(0.01f); }