class HtmlImageActionCreator {

    public static Element getImageActionElement(String imageActionStringRepresentation) {
        return new Element(Tag.valueOf("a"), "")
                .attr("href", imageActionStringRepresentation)
                .appendChild(
                        new Element(Tag.valueOf("img"), "")
                                .attr("src", imageActionStringRepresentation));
    }

}

class HtmlImageActionCreatorTest {

    @Test
    public void testGetImageActionElement() {

        String link = "{action_string_representation}";
        Element element = HtmlImageActionCreator.getImageActionElement(link);

        assertThat(element.tag().getName(), is("a"));
        assertThat(element.attr("href"), is(link));
        assertThat(element.children().size(), is(1));
        assertThat(element.children().first().tag().getName(), is("img"));
        assertThat(element.children().first().attr("src"), is(link));
    }

}