### Question:
InputParamUtil { public static String getRequiredParam(Map<String, String> parameters, String parameterKey) { if (parameters == null || parameters.get(parameterKey) == null || parameters.get(parameterKey).trim().isEmpty()) { throw new DMNRuntimeException("A '" + parameterKey + "' parameter is required."); } else { return parameters.get(parameterKey); } }  static String getRequiredParam(Map<String, String> parameters, String parameterKey); static String getOptionalParam(Map<String, String> parameters, String parameterKey, String defaultValue); static String getOptionalParam(Map<String, String> parameters, String parameterKey); static boolean getOptionalBooleanParam(Map<String, String> parameters, String paramKey); static boolean getOptionalBooleanParam(Map<String, String> parameters, String paramKey, String defaultValue);  }### Answer:
@Test public void testGetRequiredParamWherePresent() { Map<String, String> params = new HashMap<String, String>(){{ put("paramKey", "paramValue"); }}; assertEquals("paramValue", InputParamUtil.getRequiredParam(params, "paramKey")); }
@Test public void testGetRequiredParamWhereNotPresent() { Map<String, String> params = new HashMap<String, String>(){{ }}; try { InputParamUtil.getRequiredParam(params, "paramKey"); fail(); } catch (RuntimeException e) { assertEquals("A 'paramKey' parameter is required.", e.getMessage()); } }