### Question:
AbstractDiscreteDistribution implements DiscreteDistribution { @Override public double probability(int x0, int x1) { if (x1 < x0) { throw new DistributionException(DistributionException.TOO_SMALL, x1, x0); } return cumulativeProbability(x1) - cumulativeProbability(x0); }  @Override double probability(int x0,
                              int x1); @Override int inverseCumulativeProbability(final double p); static int[] sample(int n,
                               DiscreteDistribution.Sampler sampler); @Override DiscreteDistribution.Sampler createSampler(final UniformRandomProvider rng);  }### Answer:
@Test void testProbabilitiesRangeArguments() { int lower = 0; int upper = 6; for (int i = 0; i < 2; i++) { Assertions.assertEquals(1 - p * 2 * i, diceDistribution.probability(lower, upper), 1E-12); lower++; upper--; } for (int i = 0; i < 6; i++) { Assertions.assertEquals(p, diceDistribution.probability(i, i + 1), 1E-12); } }