code: private void reschedule() {
          // set up a daily roll
          Calendar cal = Calendar.getInstance();
          long today = cal.getTimeInMillis();
  
          // adjust to somewhere after midnight of the next day
          cal.set(Calendar.HOUR_OF_DAY, 0);
          cal.set(Calendar.MINUTE, 0);
          cal.add(Calendar.DATE, 1);
          long tomorrow = cal.getTimeInMillis();
  
          if (executorService != null) {
              future = executorService.schedule(this, tomorrow - today, TimeUnit.MILLISECONDS);
          }
      }
docs: Reschedule the task for midnight-ish the next day.