public static UriTemplate create(String template, Charset charset) {
    return new UriTemplate(template, true, charset);
  }
@Test
  void nestedExpressionsAreLiterals() {
    /*
     * the template of {foo{bar}}, will be treated as literals as nested templates are ignored
     */
    String template = "https://www.example.com/{foo{bar}}/{baz}";
    UriTemplate uriTemplate = UriTemplate.create(template, Util.UTF_8);
    assertThat(uriTemplate.getVariables()).contains("baz").hasSize(1);

    Map<String, Object> variables = new LinkedHashMap<>();
    variables.put("baz", "stuff");
    String expandedTemplate = uriTemplate.expand(variables);
    assertThat(expandedTemplate)
        .isEqualToIgnoringCase("https://www.example.com/%7Bfoo%7Bbar%7D%7D/stuff");
    assertThat(URI.create(expandedTemplate)).isNotNull(); // this should fail, the result is not a
                                                          // valid uri
  }