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