### Question:
EmailService { String compressHtmlSpaces(String html) { html = html.replace("\r\n", "\n"); html = replaceAll(html, " ", " "); html = replaceAll(html, "\n ", "\n"); html = replaceAll(html, "\n\n", "\n"); return html; }  void sendHtmlMessage(String from, String to, String subject, String templateName, Map<String, Object> variables, Map<String, Resource> inlineResources);  }### Answer:
@Test public void testCompressHtmlSpaces() { String html = "" + "<b>\n" + " \r\n" + " <i>html </i>\r\n" + " \r\n" + " \n\n\n" + " </b>"; html = cut.compressHtmlSpaces(html); assertThat(html).isEqualTo("" + "<b>\n" + "<i>html </i>\n" + "</b>"); }