### Question:
UrlTemplate { public UrlTemplate put(String name, String value) { UrlParameter parameter = parameters.get(name); if (parameter == null) { throw new IllegalArgumentException("Invalid parameter name: " + name); } properties.put(parameter, value); return this; } UrlTemplate(String template); void clear(); List<UrlParameter> getParameters(); UrlTemplate add(String value); UrlTemplate put(String name, String value); UrlTemplate addAll(List<String> values); UrlTemplate put(Map<String, String> values); String render(); ParsedUrlTemplate parse(String input);  }### Answer:
@Test public void testThrowsExceptionForInvalidParameterName() { UrlTemplate urlParametersTemplate = new UrlTemplate("/abc/{param1}/def{?/param2}/ghi{?/param3}"); assertThatIllegalArgumentException().isThrownBy(() -> urlParametersTemplate.put("param4", "test4")) .withMessage("Invalid parameter name: param4"); }