    @Test
    public void testLinkReplacement() {

        RichTextElementConverter converter = new RichTextElementConverter(
                Link::getUrlSlug,
                () -> "/404",
                content -> content,
                null,
                null);
        RichTextElement original = new RichTextElement();
        original.setValue("<p>Each AeroPress comes with a <a href=\"\" data-item-id=\"65832c4e-8e9c-445f-a001-b9528d13dac8\">pack of filters</a> included in the <a href=\"\" data-item-id=\"not-found\">box</a>.  See <a href=\"https://en.wikipedia.org/wiki/Coffee_filter\">Coffee filters</a>.</p>");
        Link link = new Link();
        link.setUrlSlug("/test me/\"<>&\u0080");
        HashMap<String, Link> links = new HashMap<>();
        links.put("65832c4e-8e9c-445f-a001-b9528d13dac8", link);
        original.setLinks(links);
        RichTextElement converted = converter.convert(original);
        Assert.assertEquals(
                "<p>Each AeroPress comes with a <a href=\"/test me/&#34;&#60;&#62;&#38;&#128;\" data-item-id=\"65832c4e-8e9c-445f-a001-b9528d13dac8\">pack of filters</a> included in the <a href=\"/404\" data-item-id=\"not-found\">box</a>.  See <a href=\"https://en.wikipedia.org/wiki/Coffee_filter\">Coffee filters</a>.</p>",
                converted.getValue());
    }