EnumeratedIntegerDistribution extends AbstractIntegerDistribution { public double getNumericalMean() { double mean = 0; for (final Pair<Integer, Double> sample : innerDistribution.getPmf()) { mean += sample.getValue() * sample.getKey(); } return mean; } EnumeratedIntegerDistribution(final int[] singletons, final double[] probabilities);  EnumeratedIntegerDistribution(final RandomGenerator rng,
                                       final int[] singletons, final double[] probabilities); double probability(final int x); double cumulativeProbability(final int x); double getNumericalMean(); double getNumericalVariance(); int getSupportLowerBound(); int getSupportUpperBound(); boolean isSupportConnected(); @Override int sample();  }
@Test public void testGetNumericalMean() { Assert.assertEquals(3.4, testDistribution.getNumericalMean(), 1e-10); }