public static WaitStrategy randomWait(long minimumTime,
                                          @Nonnull TimeUnit minimumTimeUnit,
                                          long maximumTime,
                                          @Nonnull TimeUnit maximumTimeUnit) {
        Preconditions.checkNotNull(minimumTimeUnit, "The minimum time unit may not be null");
        Preconditions.checkNotNull(maximumTimeUnit, "The maximum time unit may not be null");
        return new RandomWaitStrategy(minimumTimeUnit.toMillis(minimumTime),
                maximumTimeUnit.toMillis(maximumTime));
    }
public static WaitStrategy randomWait ( long minimumTime , @ Nonnull TimeUnit minimumTimeUnit , long maximumTime , @ Nonnull TimeUnit maximumTimeUnit ) { Preconditions . checkNotNull ( minimumTimeUnit , "The minimum time unit may not be null" ) ; Preconditions . checkNotNull ( maximumTimeUnit , "The maximum time unit may not be null" ) ; return new RandomWaitStrategy ( minimumTimeUnit . toMillis ( minimumTime ) , maximumTimeUnit . toMillis ( maximumTime ) ) ; }
Returns a strategy that sleeps a random amount of time before retrying.

@param minimumTime     the minimum time to sleep
@param minimumTimeUnit the unit of the minimum time
@param maximumTime     the maximum time to sleep
@param maximumTimeUnit the unit of the maximum time
@return a wait strategy with a random wait time
@throws IllegalStateException if the minimum sleep time is &lt; 0, or if the
maximum sleep time is less than (or equals to) the minimum.