code: public static String durationToFormattedString(final Duration duration) {
          if (duration == null) {
              return null;
          }
  
          return LocalTime.ofNanoOfDay(duration.toNanos()).format(DateTimeFormatter.ofPattern(DURATION_FORMAT));
      }
docs: Converts a Duration into a formatted String
  
  @param duration
  duration, which will be converted into a formatted String
  @return String in the duration format, specified at
  {@link #DURATION_FORMAT}