### Question:
HtmlUtils { public static CharSequence escapeAttribute(CharSequence value) { return Strings.replaceAll( Strings.replaceAll(value, "&", "&amp;"), "\"", "&quot;" ); } private  HtmlUtils(); static CharSequence escapeAttribute(CharSequence value);  }### Answer:
@Test public void testEscapeAttribute_quoted() { String s = "Please click \"ok\" to continue."; Assert.assertEquals( "Please click &quot;ok&quot; to continue.", HtmlUtils.escapeAttribute(s).toString() ); }
@Test public void testEscapeAttribute_both() { String s = "The \"&\" is tricky."; Assert.assertEquals( "The &quot;&amp;&quot; is tricky.", HtmlUtils.escapeAttribute(s).toString() ); }
@Test public void testEscapeAttribute_url() { String s = "http: Assert.assertEquals( "http: HtmlUtils.escapeAttribute(s).toString() ); }