@Test
public void simpleTemplate() {

  String template = "https://www.example.com/foo/{bar}";
  UriTemplate uriTemplate = UriTemplate.create(template, Util.UTF_8);
  /* verify that the template has 1 variables names foo */
  List<String> uriTemplateVariables = uriTemplate.getVariables();
  assertThat(uriTemplateVariables).contains("bar").hasSize(1);
  /* expand the template */
  Map<String, Object> variables = new LinkedHashMap<>();
  variables.put("bar", "bar");
  String expandedTemplate = uriTemplate.expand(variables);
  assertThat(expandedTemplate).isEqualToIgnoringCase("https://www.example.com/foo/bar");
  assertThat(URI.create(expandedTemplate)).isNotNull();
}