private static int adjustIntervalIfJitterIsEnabled(final long intervalMillis) {
    final int minLegal = minimum();
    final int maxLegal = maximum();

    if (intervalMillis <= minLegal) {
      return (int) intervalMillis; // Don't ever jitter anything below this.
    }

    int maxValue = maxLegal;
    if (intervalMillis < maxLegal) {
      maxValue = (int) intervalMillis;
    }

    return minLegal + jitter.nextInt(maxValue - minLegal + 1);
  }
If jittering is enabled then returns a jittered interval up to a maximum of
<code>intervalMillis</code> milliseconds, inclusive.

If jittering is disabled then returns <code>intervalMillis</code>.

The result is bounded by 50 ms as a minimum and 5000 ms as a maximum.

@param intervalMillis total amount of time to wait
@return randomized interval we should wait
geode-dunit/src/main/java/org/apache/geode/test/dunit/Jitter.java