code: public Duration getDuration(String property, Duration defaultValue) {
      return getProperty(property, defaultValue, value -> {
        try {
          return Durations.of(value);
        } catch (NumberFormatException e) {
          throw new ConfigurationException("malformed property value: " + property + " must be a number");
        }
      });
    }
docs: Reads a duration property.
  
  @param property The property name.
  @param defaultValue The default value to return if the property is not present
  @return The property value.