### Question:
TitleRule implements Rule<JDocCommentable, JDocComment> { @Override public JDocComment apply(String nodeName, JsonNode node, JsonNode parent, JDocCommentable generatableType, Schema schema) { JDocComment javadoc = generatableType.javadoc(); javadoc.add(0, node.asText() + "\n<p>\n"); return javadoc; } protected  TitleRule(); @Override JDocComment apply(String nodeName, JsonNode node, JsonNode parent, JDocCommentable generatableType, Schema schema);  }### Answer:
@Test public void applyAddsDescriptionToJavadoc() throws JClassAlreadyExistsException { JDefinedClass jclass = new JCodeModel()._class(TARGET_CLASS_NAME); ObjectMapper mapper = new ObjectMapper(); TextNode titleNode = mapper.createObjectNode().textNode("some title"); JDocComment result = rule.apply("fooBar", titleNode, null, jclass, null); assertThat(result, sameInstance(jclass.javadoc())); assertThat(result.size(), is(1)); assertThat(result.get(0), is("some title\n<p>\n")); }