### Question:
UrlTemplate { public String render() { String rendered = template; for (UrlParameter parameter : parameters.values()) { Object value = properties.get(parameter); String group = parameter.getGroup(); if (value == null && !parameter.isOptional()) { throw new IllegalArgumentException(String.format("Value for parameter %s is missing.", parameter)); } else { rendered = rendered.replaceAll(Pattern.quote(String.format("{%s}", group)), buildRenderReplacement(parameter, value == null ? null : String.valueOf(value))); } } return rendered; } 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 testRender() { UrlTemplate urlParametersTemplate = new UrlTemplate("/abc/{param1}/def/{param2}/{param3}"); String url = urlParametersTemplate.add("test1").add("test2").add("test3").render(); assertThat(getParameterNames(urlParametersTemplate)).containsExactly("param1", "param2", "param3"); assertThat(getParameterOptionals(urlParametersTemplate)).containsExactly(false, false, false); assertThat(url).isEqualTo("/abc/test1/def/test2/test3"); }