docs: public static long toDurationMillis(String duration) {
  		Matcher matcher = NUMBER_AND_UNIT.matcher(duration);
  
  		if (!matcher.matches()) {
  			throw new IllegalArgumentException("malformed duration string: " + duration);
  		}
  
  		long number = Long.parseLong(matcher.group(1));
  		String unitStr = matcher.group(2);
  		if (unitStr == null) {
  			return number;
  		}
  
  		char unit = unitStr.toLowerCase().charAt(0);
  
  		switch (unit) {
  			case 's':
  				return number * MILLIS_PER_SECOND;
  			case 'm':
  				// if it's an m, could be 'minutes' or 'millis'. default minutes
  				if (unitStr.length() >= 2 && unitStr.charAt(1) == 's') {
  					return number;
  				}
  
  				return number * MILLIS_PER_MINUTE;
  			case 'h':
  				return number * MILLIS_PER_HOUR;
  			case 'd':
  				return number * MILLIS_PER_DAY;
  			default:
  				throw new IllegalArgumentException("unknown time unit :" + unit);
  		}
  	}