private static int getDelayMillis(int attemptNumber) {
    // [0 - 5 seconds] check each 500 ms
    if (attemptNumber < 10) {
      return 500;
    }
    // [5 - 25 seconds] check each 1000 ms
    if (attemptNumber < 20) {
      return 1000;
    }
    // [25 - 425 seconds] check each 5000 ms
    return 5000;
  }
private static int getDelayMillis(int attemptNumber)