@Test public void getScheduleDelay_withMinTimestampAndFirstAttempt_shouldReturnExpectedValue() { long delay = createConfig(Collections.emptySet(), DELTA).getScheduleDelay(Priority.DEFAULT, 50, 1); assertThat(delay).isEqualTo(50); }
public long getScheduleDelay(Priority priority, long minTimestamp, int attemptNumber) { long timeDiff = minTimestamp - getClock().getTime(); ConfigValue config = getValues().get(priority); long delay = Math.max(adjustedExponentialBackoff(attemptNumber, config.getDelta()), timeDiff); return Math.min(delay, config.getMaxAllowedDelay()); }
SchedulerConfig { public long getScheduleDelay(Priority priority, long minTimestamp, int attemptNumber) { long timeDiff = minTimestamp - getClock().getTime(); ConfigValue config = getValues().get(priority); long delay = Math.max(adjustedExponentialBackoff(attemptNumber, config.getDelta()), timeDiff); return Math.min(delay, config.getMaxAllowedDelay()); } }
SchedulerConfig { public long getScheduleDelay(Priority priority, long minTimestamp, int attemptNumber) { long timeDiff = minTimestamp - getClock().getTime(); ConfigValue config = getValues().get(priority); long delay = Math.max(adjustedExponentialBackoff(attemptNumber, config.getDelta()), timeDiff); return Math.min(delay, config.getMaxAllowedDelay()); }  }
SchedulerConfig { public long getScheduleDelay(Priority priority, long minTimestamp, int attemptNumber) { long timeDiff = minTimestamp - getClock().getTime(); ConfigValue config = getValues().get(priority); long delay = Math.max(adjustedExponentialBackoff(attemptNumber, config.getDelta()), timeDiff); return Math.min(delay, config.getMaxAllowedDelay()); }  static SchedulerConfig getDefault(Clock clock); static SchedulerConfig.Builder builder(); long getScheduleDelay(Priority priority, long minTimestamp, int attemptNumber); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) JobInfo.Builder configureJob(
      JobInfo.Builder builder, Priority priority, long minimumTimestamp, int attemptNumber); Set<Flag> getFlags(Priority priority); }
SchedulerConfig { public long getScheduleDelay(Priority priority, long minTimestamp, int attemptNumber) { long timeDiff = minTimestamp - getClock().getTime(); ConfigValue config = getValues().get(priority); long delay = Math.max(adjustedExponentialBackoff(attemptNumber, config.getDelta()), timeDiff); return Math.min(delay, config.getMaxAllowedDelay()); }  static SchedulerConfig getDefault(Clock clock); static SchedulerConfig.Builder builder(); long getScheduleDelay(Priority priority, long minTimestamp, int attemptNumber); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) JobInfo.Builder configureJob(
      JobInfo.Builder builder, Priority priority, long minimumTimestamp, int attemptNumber); Set<Flag> getFlags(Priority priority);  }