### Question:
RequireWidget implements Renderable { public void render(Object bound, Respond respond) { StringBuilderRespond inner = new StringBuilderRespond(bound); widget.render(bound, inner); respond.require(inner.toString()); } RequireWidget(XmlWidget child); void render(Object bound, Respond respond); Set<T> collect(Class<T> clazz);  }### Answer:
@Test(dataProvider = REQUIRE_TAGS) public final void requireWidgetsRenderToHeadTag(final String requireString) throws ExpressionCompileException { final Respond respond = RespondersForTesting.newRespond(); respond.require(requireString); respond.require(requireString); WidgetChain chain = new ProceedingWidgetChain(); final MvelEvaluatorCompiler compiler = new MvelEvaluatorCompiler(Object.class); chain.addWidget(new HeaderWidget(new TerminalWidgetChain(), Maps.<String, String>newHashMap(), compiler)); List<Node> nodes = HtmlParser.parse("<html>" + requireString + "</html>"); Node node = nodes.get(0).childNode(0); WidgetChain inner = Chains.terminal(); if (!node.childNodes().isEmpty()) inner = Chains.singleton(new TextWidget(node.childNode(0).toString(), compiler)); chain.addWidget(new RequireWidget(new XmlWidget(inner, node.nodeName(), compiler, HtmlTemplateCompiler.parseAttribs(node.attributes())))); chain.addWidget(new RequireWidget(new XmlWidget(inner, node.nodeName(), compiler, HtmlTemplateCompiler.parseAttribs(node.attributes())))); chain.addWidget(new RequireWidget(new XmlWidget(inner, node.nodeName(), compiler, HtmlTemplateCompiler.parseAttribs(node.attributes())))); chain.render(new Object(), respond); final String expected = "<head>" + requireString + "</head>"; final String output = respond.toString(); assert expected.equals(output) : "Header not correctly rendered. Was: \n" + output + "\n-- but expected: --\n" + expected; }