### Question:
ExponentialSampler implements Sampler<Double> { public Double sample() { return - Math.log(1.0 - rng.nextDouble()) / lambda; } ExponentialSampler(double lambda, SeedFactory seedFactory); Double sample();  }### Answer:
@Test public void testSample() throws Exception { double lambda = 1.0 / 2.0; SeedFactory seedFactory = new SeedFactory(1234); Sampler<Double> sampler = new ExponentialSampler(lambda, seedFactory); Double result = sampler.sample(); assertTrue(result >= 0.0); }