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