code: public static Duration formattedStringToDuration(final String formattedDuration) {
          if (formattedDuration == null) {
              return null;
          }
  
          final TemporalAccessor ta = DateTimeFormatter.ofPattern(DURATION_FORMAT).parse(formattedDuration.trim());
          return Duration.between(LocalTime.MIDNIGHT, LocalTime.from(ta));
      }
docs: Converts a formatted String into a Duration object.
  
  @param formattedDuration
  String in {@link #DURATION_FORMAT}
  @return duration
  @throws DateTimeParseException
  when String is in wrong format