@Override
    public double mean() {
        return r * (1 - p) / p;
    }
@Test
    public void testMean() {
        System.out.println("mean");
        NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);
        instance.rand();
        assertEquals(7, instance.mean(), 1E-7);
    }