Jitter { public static long addOnePercentJitter(long value) { if (value == 0 || value < 100) { return value; } return value + random.nextInt((int) Math.abs(value) / 100); }  static long addOnePercentJitter(long value);  }
@Test public void testAddOnePercentJitter() throws IOException { long[] baseArray = {-2232, -1, 0, 99, 100, 101, 1000, 10000, 38742}; for (long base : baseArray) { assertThat(Jitter.addOnePercentJitter(base)).isBetween(base, base + Math.abs(base)/100); } }