### Question:
LinkEmbedding extends StructuredEmbedding { @Override public String toHtml() { Object url = getData(); if (url == null) { return ""; } final String escapedUrl = StringEscapeUtils.escapeXml10(url.toString()); return "<a href=\"" + escapedUrl + "\">SHOW</a>" + " (Open in a new tab if it is not opening)"; } LinkEmbedding(String kind, String name, String url, EmbeddingPriority priority); @Override String toHtml();  }### Answer:
@Test public void toHtml_ShouldEscapeHtmlCharacters_WhenUrlContainsHtmlCharacters() { final String urlWithHtml = "Escaping<test> &amp; \"checked'"; final LinkEmbedding cut = new LinkEmbedding(null, null, urlWithHtml, null); final String html = cut.toHtml(); assertThat(html).isEqualTo("" + "<a href=\"Escaping&lt;test&gt; &amp;amp; &quot;checked&apos;\">SHOW</a> " + "(Open in a new tab if it is not opening)"); }
@Test public void toHtml_ShouldReturnEmpty_WhenUrlIsNull() { final String nullUrl = null; final LinkEmbedding cut = new LinkEmbedding(null, null, nullUrl, null); final String html = cut.toHtml(); assertThat(html).isEmpty(); }