### Question:
TDistribution extends AbstractContinuousDistribution { @Override public double cumulativeProbability(double x) { if (x == 0) { return 0.5; } else { final double t = RegularizedBeta.value(degreesOfFreedom / (degreesOfFreedom + (x * x)), dofOver2, 0.5); return x < 0 ? 0.5 * t : 1 - 0.5 * t; } } TDistribution(double degreesOfFreedom); double getDegreesOfFreedom(); @Override double density(double x); @Override double logDensity(double x); @Override double cumulativeProbability(double x); @Override double getMean(); @Override double getVariance(); @Override double getSupportLowerBound(); @Override double getSupportUpperBound(); @Override boolean isSupportConnected();  }### Answer:
@Test void testCumulativeProbabilityAgainstStackOverflow() { Assertions.assertDoesNotThrow(() -> { final TDistribution td = new TDistribution(5.); td.cumulativeProbability(.1); td.cumulativeProbability(.01); }); }
@Test void testCumulativeProbablilityExtremes() { TDistribution dist; for (int i = 1; i < 11; i++) { dist = new TDistribution(i * 5); Assertions.assertEquals(1, dist.cumulativeProbability(Double.POSITIVE_INFINITY), Double.MIN_VALUE); Assertions.assertEquals(0, dist.cumulativeProbability(Double.NEGATIVE_INFINITY), Double.MIN_VALUE); } }