public String render(String name, Map<String, Object> scope, Locale locale) {
    var template = mf.compile(name);
    var w = new StringWriter();
    var modifiableScope = new HashMap<>(scope);
    modifiableScope.put("trans", new TranslateBundleFunction("i18n", locale));
    template.execute(w, modifiableScope);
    return w.toString();
  }
@Test
  void render() {

    var mf = mock(MustacheFactory.class);
    var template = mock(Mustache.class);

    var sut = new TemplateRenderer(mf);

    var name = "mytemplate.mustache";
    var translateBundleFunction = new TranslateBundleFunction("i18n", Locale.US);

    var scope = new HashMap<String, Object>();
    scope.put("trans", translateBundleFunction);

    when(mf.compile(name)).thenReturn(template);

    // when
    var got = sut.render(name, scope, Locale.US);

    // then
    verify(mf).compile(name);
    verify(template).execute(any(), anyMap());
  }