code: @Override
    public Date computeFirstFireTime(Calendar calendar) {
  
      nextFireTime = getStartTime();
  
      while (nextFireTime != null
          && calendar != null
          && !calendar.isTimeIncluded(nextFireTime.getTime())) {
        nextFireTime = getFireTimeAfter(nextFireTime);
  
        if (nextFireTime == null) {
          break;
        }
  
        // avoid infinite loop
        java.util.Calendar c = java.util.Calendar.getInstance();
        c.setTime(nextFireTime);
        if (c.get(java.util.Calendar.YEAR) > YEAR_TO_GIVEUP_SCHEDULING_AT) {
          return null;
        }
      }
  
      return nextFireTime;
    }
docs: Called by the scheduler at the time a <code>Trigger</code> is first added to the scheduler, in
  order to have the <code>Trigger</code> compute its first fire time, based on any associated
  calendar.
  
  <p>After this method has been called, <code>getNextFireTime()</code> should return a valid
  answer.
  
  @return the first time at which the <code>Trigger</code> will be fired by the scheduler, which
  is also the same value <code>getNextFireTime()</code> will return (until after the first
  firing of the <code>Trigger</code>).