private static List<String> createMustacheKeysFromTemplate(
     FacesContext context, UIComponentBase component, String facetKey) throws IOException {
   final UIComponent templateFacet = component.getFacet(facetKey);
   if (templateFacet != null) {
     final String encodedTemplate =
         StringHtmlEncoder.encodeComponentWithSurroundingDiv(context, templateFacet);
     return MustacheResolver.getMustacheKeysForTreeNode(encodedTemplate);
   } else {
     return Collections.emptyList();
   }
 }