code: public static String getOptionalStringParameter(Map<String, String> parameters,
                                                      String parameterName,
                                                      String defaultValue) {
          validateParameters(parameters);
          validateParameterName(parameterName);
  
          String value = parameters.get(parameterName);
          return value == null ? defaultValue : value;
      }
docs: Get an optional String parameter, If not found, use the default value.
  
  @throws NullPointerException
  if either 'parameters' or 'parameterName' is null.