### Question:
Escape { public static void html(StringBuilder sb, String html) { for (int i = 0; i < html.length(); i++) { char c = html.charAt(i); switch (c) { case '&': sb.append("&amp;"); break; case '"': sb.append("&quot;"); break; case '\'': sb.append("&apos;"); break; case '<': sb.append("&lt;"); break; case '>': sb.append("&gt;"); break; default: sb.append(c); } } } private  Escape(); static void html(StringBuilder sb, String html); static String html(String html); static void xml(StringBuilder sb, String xml); static String xml(String xml);  }### Answer:
@Test public void shouldEscapeBasicHTML(){ the(Escape.html("<script>alert(\"This & that, it's the problem.\");</script>")).shouldBeEqual( "&lt;script&gt;alert(&quot;This &amp; that, it&apos;s the problem.&quot;);&lt;/script&gt;"); }
@Test public void shouldNotEscapeHighUnicode() { String unicode = "\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\u306E\u30D9\u30F3\u30C1\u30DE\u30FC\u30AF"; the(Escape.html(unicode)).shouldBeEqual(unicode); }