StringUtils { public static Spanned createSpannedHtmlLink(String name, String url) { return CompatibilityUtils.fromHtml(String.format(Locale.US, "<a href=\"%s\">%s</a>", url, name)); } private  StringUtils(); static String appendOptional(String first, String second); static String appendOptional(String first, String second, String separator); static String strJoin(List<String> entries, String separator); static int addLineSeparator(SpannableStringBuilder sb, boolean force); static int addLineSeparator(SpannableStringBuilder sb); static Spanned createSpannedHtmlLink(String name, String url); static final String COMMA_SEPARATOR; static final String LINE_SEPARATOR; static final String HTML_LINE_SEPARATOR; static final String ZERO_WIDTH_SPACE; }
@Test public void should_create_spanned_html_link() { String name = "website"; String url = "http: Spanned htmlLink = StringUtils.createSpannedHtmlLink(name, url); assertThat(htmlLink.toString()).isEqualTo(CompatibilityUtils.fromHtml("<a href=\"" + url + "\">" + name).toString()); }