code: public static List<Instant> instantsInRange(Instant firstInstant, Instant lastInstant,
                                                Schedule schedule) {
      Preconditions.checkArgument(
          isAligned(firstInstant, schedule) && isAligned(lastInstant, schedule),
          "unaligned instant");
      Preconditions.checkArgument(!lastInstant.isBefore(firstInstant),
          "last instant should not be before first instant");
  
      final ExecutionTime executionTime = ExecutionTime.forCron(cron(schedule));
      final List<Instant> instants = new ArrayList<>();
  
      Instant currentInstant = firstInstant;
      while (currentInstant.isBefore(lastInstant)) {
        instants.add(currentInstant);
        final ZonedDateTime utcDateTime = currentInstant.atZone(UTC);
        currentInstant = executionTime.nextExecution(utcDateTime)
            .orElseThrow(IllegalArgumentException::new) // with unix cron, this should not happen
            .toInstant();
      }
  
      return instants;
    }
docs: Gets an ordered list of instants between firstInstant (inclusive) and lastInstant (exclusive)
  according to the {@link Schedule}.
  
  @param firstInstant The first instant
  @param lastInstant  The last instant
  @param schedule     The schedule of the workflow
  @return instants within the range