@Test
  public void testHtmlReplaceAll() {
    String regex = "\\s";
    String replacement = "";
    String expected, actual;
    // test all tags
    String text = "<html tag></html>";
    assertEquals(text, MiscUtils.htmlReplaceAll(text, regex, replacement));

    text = "<html tag>Text</html>";
    // test no replacement
    assertEquals(text, MiscUtils.htmlReplaceAll(text, regex, replacement));

    // test replacement
    text = "<html tag>  Text with spaces  </html>";
    expected = "<html tag>Textwithspaces</html>";
    actual = MiscUtils.htmlReplaceAll(text, regex, replacement);
    assertEquals(expected, actual);

    // test replacement with trailing characters
    text += "  not html  ";
    expected += "nothtml";
    actual = MiscUtils.htmlReplaceAll(text, regex, replacement);
    assertEquals(expected, actual);
  }