### Question:
HtmlTagHandler extends AbstractTagHandler { public void process(Node result, Element tag, TemplateProcessor processor) { String code = getValueFromTag(tag, ATTR_CODE, processor, String.class); if ((code == null) || "".equals(code)) { return; } try { parser.parseFragment(code, result); } catch (GadgetException ge) { try { StringBuilder sb = new StringBuilder("Error: "); HtmlSerialization.printEscapedText(ge.getMessage(), sb); Node comment = result.getOwnerDocument().createComment(sb.toString()); result.appendChild(comment); } catch (IOException e) { throw new RuntimeException(e); } } } @Inject  HtmlTagHandler(GadgetHtmlParser parser); void process(Node result, Element tag, TemplateProcessor processor);  }### Answer:
@Test public void testHtmlTag() throws Exception { Document doc = documentProvider.createDocument(null, null, null); Element tag = doc.createElement("test"); tag.setAttribute("code", "${code}"); processor.expressionResults = ImmutableMap.of( "${code}", "Hello <b>World</b>!"); DocumentFragment fragment = doc.createDocumentFragment(); handler.process(fragment, tag, processor); assertEquals(3, fragment.getChildNodes().getLength()); assertEquals("b", fragment.getChildNodes().item(1).getNodeName()); }