### Question:
ParameterHelper implements JournalConstants { 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; } private  ParameterHelper(); static String getOptionalStringParameter(Map<String, String> parameters,
                                                    String parameterName,
                                                    String defaultValue); static boolean getOptionalBooleanParameter(Map<String, String> parameters,
                                                      String parameterName,
                                                      boolean defaultValue); static File parseParametersForWritableDirectory(Map<String, String> parameters,
                                                           String parameterName); static String parseParametersForFilenamePrefix(Map<String, String> parameters); static long parseParametersForSizeLimit(Map<String, String> parameters); static long parseParametersForAgeLimit(Map<String, String> parameters);  }### Answer:
@Test public void testGetOptionalStringParameter_Value() { parameters.put("fred", "theValue"); String result = ParameterHelper.getOptionalStringParameter(parameters, "fred", "WhoCares?"); assertEquals("theValue", result); }
@Test public void testGetOptionalStringParameter_Default() { String result = ParameterHelper.getOptionalStringParameter(parameters, "fred", "WhoCares?"); assertEquals("WhoCares?", result); }