code: public static void validateMaintenanceSchedule(final String cronSchedule, final String duration,
              final String timezone) {
          if (allNotEmpty(cronSchedule, duration, timezone)) {
              validateCronSchedule(cronSchedule);
              validateDuration(duration);
              // check if there is a window currently active or available in
              // future.
              if (!getNextMaintenanceWindow(cronSchedule, duration, timezone).isPresent()) {
                  throw new InvalidMaintenanceScheduleException(
                          "No valid maintenance window available after current time");
              }
          } else if (atLeastOneNotEmpty(cronSchedule, duration, timezone)) {
              throw new InvalidMaintenanceScheduleException(
                      "All of schedule, duration and timezone should either be null or non empty.");
          }
      }
docs: Check if the maintenance schedule definition is valid in terms of
  validity of cron expression, duration and availability of at least one
  valid maintenance window. Further a maintenance schedule is valid if
  either all the parameters: schedule, duration and time zone are valid or
  are null.
  
  @param cronSchedule
  is a cron expression with 6 mandatory fields and 1 last
  optional field: "second minute hour dayofmonth month weekday
  year".
  @param duration
  in HH:mm:ss format specifying the duration of a maintenance
  window, for example 00:30:00 for 30 minutes.
  @param timezone
  is the time zone specified as +/-hh:mm offset from UTC. For
  example +02:00 for CET summer time and +00:00 for UTC. The
  start time of a maintenance window calculated based on the
  cron expression is relative to this time zone.
  
  @throws InvalidMaintenanceScheduleException
  if the defined schedule fails the validity criteria.