### Question:
ProbabilitySampler implements Sampler { @Override public boolean isSampled(Id traceId) { final long leastSignificantBits = traceId.getLeastSignificantBits(); return leastSignificantBits > lowerBound && leastSignificantBits < higherBound; } private  ProbabilitySampler(double samplingRate); static Sampler of(double samplingRate); @Override boolean isSampled(Id traceId); @Override double getSampleRate(); @Override String getSampleRateString();  }### Answer:
@Test void isSampledEmpiricalTest() { int sampledTransactions = 0; Id id = Id.new128BitId(); for (int i = 0; i < ITERATIONS; i++) { id.setToRandomValue(); if (sampler.isSampled(id)) { sampledTransactions++; } } assertThat(sampledTransactions).isBetween((int) (SAMPLING_RATE * ITERATIONS - DELTA), (int) (SAMPLING_RATE * ITERATIONS + DELTA)); }