public static UriTemplate create(String template, Charset charset) {
    return new UriTemplate(template, true, charset);
  }
@Test
  void simpleTemplateUnresolvedVariablesAreRemoved() {
    String template = "https://www.example.com/{foo}?name={name}";
    UriTemplate uriTemplate = UriTemplate.create(template, Util.UTF_8);
    assertThat(uriTemplate.getVariables()).contains("foo", "name").hasSize(2);

    Map<String, Object> variables = new LinkedHashMap<>();
    variables.put("name", "Albert");
    String expandedTemplate = uriTemplate.expand(variables);
    assertThat(expandedTemplate).isEqualToIgnoringCase("https://www.example.com/?name=Albert");
    assertThat(URI.create(expandedTemplate)).isNotNull();
  }