code: public static void validateDuration(final String duration) {
          try {
              if (StringUtils.hasText(duration)) {
                  convertDurationToLocalTime(duration);
              }
          } catch (final DateTimeParseException e) {
              throw new InvalidMaintenanceScheduleException("Provided duration is not valid", e, e.getErrorIndex());
          }
      }
docs: Validates the format of the maintenance window duration
  
  @param duration
  in "HH:mm:ss" string format. This format is popularly used but
  can be confused with time of the day, hence conversion to ISO
  specified format for time duration is required.
  
  @throws InvalidMaintenanceScheduleException
  if the duration doesn't have a valid format to be converted
  to ISO.