### Question:
StudentTTwoTailedCriticalValueCalculator implements Function<Double, Double> { @Override public Double apply(Double x) { ArgChecker.notNull(x, "x"); ArgChecker.notNegative(x, "x"); return _calc.apply(0.5 + 0.5 * x); } StudentTTwoTailedCriticalValueCalculator(double nu);  StudentTTwoTailedCriticalValueCalculator(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, y; final double eps = 1e-5; for (int i = 0; i < 100; i++) { x = RANDOM.nextDouble(); y = 0.5 * (1 + x); assertThat(y).isCloseTo(T.getCDF(F.apply(x)), offset(eps)); } }