code: public static Duration of(String duration) {
      Matcher matcher = PATTERN.matcher(duration);
      Assert.isTrue(matcher.matches(), "Invalid duration: %s", duration);
  
      if (matcher.group(1) != null) {
        return INFINITE;
      } else {
        String unit = matcher.group(4);
        String value = matcher.group(3);
        return new Duration(Long.parseLong(value), SUFFIXES.get(unit));
      }
    }
docs: Returns a Duration from the parsed {@code duration}. Example:
  
  <pre>
  5 s
  5 seconds
  10m
  10 minutes
  </pre>