### Question:
UniformIntSampler implements Sampler<Integer> { public Integer sample() { int range = upperbound + 1 - lowerbound; return rng.nextInt(range) + lowerbound; } UniformIntSampler(int lowerbound, int upperbound, SeedFactory seedFactory); Integer sample();  }### Answer:
@Test public void testSample() throws Exception { int upperbound = 10; int lowerbound = 1; SeedFactory seedFactory = new SeedFactory(1234); Sampler<Integer> sampler = new UniformIntSampler(lowerbound, upperbound, seedFactory); Integer result = sampler.sample(); assertTrue(result >= lowerbound); assertTrue(result <= upperbound); }
@Test public void testSampleInclusive() throws Exception { int upperbound = 2; int lowerbound = 1; SeedFactory seedFactory = new SeedFactory(1234); Sampler<Integer> sampler = new UniformIntSampler(lowerbound, upperbound, seedFactory); Integer result = sampler.sample(); assertTrue(result >= lowerbound); assertTrue(result <= upperbound); }