### Question:
StudentTOneTailedCriticalValueCalculator implements Function<Double, Double> { @Override public Double apply(Double x) { ArgChecker.notNull(x, "x"); ArgChecker.notNegative(x, "x"); if (DoubleMath.fuzzyEquals(x, 0.5, 1e-14)) { return 0.5; } return _dist.getInverseCDF(x); } StudentTOneTailedCriticalValueCalculator(double nu);  StudentTOneTailedCriticalValueCalculator(double nu, RandomEngine engine); @Override Double apply(Double x);  }### Answer:
@Test public void testNull() { assertThatIllegalArgumentException() .isThrownBy(() -> F.apply((Double) null)); }
@Test public void testNegative() { assertThatIllegalArgumentException() .isThrownBy(() -> F.apply(-4.)); }
@Test public void test() { double x; final double eps = 1e-5; for (int i = 0; i < 100; i++) { x = RANDOM.nextDouble(); assertThat(x).isCloseTo(F.apply(T.getCDF(x)), offset(eps)); } }