public static StopStrategy stopAfterDelay(long duration, @Nonnull TimeUnit timeUnit) {
        Preconditions.checkNotNull(timeUnit, "The time unit may not be null");
        return new StopAfterDelayStrategy(timeUnit.toMillis(duration));
    }
public static StopStrategy stopAfterDelay ( long duration , @ Nonnull TimeUnit timeUnit ) { Preconditions . checkNotNull ( timeUnit , "The time unit may not be null" ) ; return new StopAfterDelayStrategy ( timeUnit . toMillis ( duration ) ) ; }
Returns a stop strategy which stops after a given delay. If an
unsuccessful attempt is made, this {@link StopStrategy} will check if the
amount of time that's passed from the first attempt has exceeded the
given delay amount. If it has exceeded this delay, then using this
strategy causes the retrying to stop.

@param duration the delay, starting from first attempt
@param timeUnit the unit of the duration
@return a stop strategy which stops after {@code delayInMillis} time in milliseconds