@Test
public void testRandom() {

    double s = 0;
    double ssq=0;
    int N = 1000000;
    long t0 = System.currentTimeMillis();
    Gamma dist = new Gamma(7.48, 0.295);
    MersenneTwister rng = new MersenneTwister(0);
    for (int i = 0; i < N; ++i) {
        double r=dist.random(rng);
        s += r;
        ssq+=r*r;
    }
    long t1 = System.currentTimeMillis();
    assertEquals(dist.getExpectation(), s / N, .01);
    assertEquals(dist.getVariance(), ssq / N-s/N*s/N, .01);
      System.out.println("New");
      System.out.println(t1 - t0);
      System.out.println(s / N);
      System.out.println(ssq / N-s/N*s/N);
      System.out.println(dist.getExpectation());
      System.out.println(dist.getVariance());
}