private static interface DataGenFactory {
public abstract DataGenerator make(double param);
}
private long doTest(DataGenFactory fact, byte[] buf, Random rng, int trials, double param) {
DataGenerator gen = fact.make(param);
long start = System.nanoTime();
for (int j = 0; j < trials; j++) {
gen.fill(rng, buf);
}
long end = System.nanoTime();
long timeTaken = end - start;
return timeTaken;
}