### Question:
TextEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object text = getData(); return (text == null ? "" : StringEscapeUtils.escapeXml10(text.toString())); } TextEmbedding(String kind, String name, String text, EmbeddingPriority priority); @Override String toHtml();  }### Answer:
@Test public void toHtml_ShouldReturnEmpty_WhenDataIsNull() { final String nullText = null; final TextEmbedding cut = new TextEmbedding(null, null, nullText, null); final String html = cut.toHtml(); assertThat(html).isEmpty(); }
@Test public void toHtml_ShouldEscapeHtmlCharacters_WhenDataContainsHtmlCharacters() { final String textWithHtml = "Escaping<test> &amp; \"checked'"; final TextEmbedding cut = new TextEmbedding(null, null, textWithHtml, null); final String html = cut.toHtml(); assertThat(html).isEqualTo("Escaping&lt;test&gt; &amp;amp; &quot;checked&apos;"); }