ConstantRealDistribution extends AbstractRealDistribution { @Override public double sample() { return value; } ConstantRealDistribution(double value); double density(double x); double cumulativeProbability(double x); @Override double inverseCumulativeProbability(final double p); double getNumericalMean(); double getNumericalVariance(); double getSupportLowerBound(); double getSupportUpperBound(); boolean isSupportLowerBoundInclusive(); boolean isSupportUpperBoundInclusive(); boolean isSupportConnected(); @Override double sample(); @Override void reseedRandomGenerator(long seed);  }
@Test public void testSampling() { ConstantRealDistribution dist = new ConstantRealDistribution(0); for (int i = 0; i < 10; i++) { Assert.assertEquals(0, dist.sample(), 0); } }