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