Sampling { public abstract boolean trace();  abstract boolean trace(); static Sampling valueOf(String samplerName); static final Sampling ON; static final Sampling OFF; }
@Test public void testSamplingOffNeverSamples() { Sampling sampler = Sampling.OFF; for (int i = 0; i < 10; i++) { assertFalse(sampler.trace()); } }
@Test public void testSamplingOnAlwaysSamples() { Sampling sampler = Sampling.ON; for (int i = 0; i < 10; i++) { assertTrue(sampler.trace()); } }