### Question:
HtmlHelper { public static int countTags(String htmlText) { return countTags(htmlText, false); } private  HtmlHelper(); static int countTags(String htmlText); static int countTagLength(String taggedText); static int countTags(String htmlText, boolean distinct); static String stripHtmlTags(String htmlText); static String stripHtmlTags(String htmlText, String replacement); @Deprecated static String stripHtmlTags(String htmlText, Set<HtmlElement> htmlElements); static String stripHtmlTags(String htmlText, HtmlElement... htmlElements); static String joinTagsAndRemoveNewLines(String htmlText); static String removeConcreteHtmlTag(String pageString, String tag); static String removeConcreteHtmlTag(String pageContent, String beginTag, String endTag); static List<String> getConcreteTags(String pageString, String tag); static List<String> getConcreteTags(String pageString, String beginTag, String endTag); static String documentToReadableText(Node node); static String htmlToReadableText(String htmlString); static String extractTagElement(final String pattern, final String content, final String removeTerm); static boolean isSimpleElement(Node node); static boolean isHeadlineTag(String tag); static boolean isHeadlineTag(Node tag); static Node removeWhitespace(Node node); static boolean writeToFile(Node node, File file); static String getInnerXml(Node node); static Document createDocument(); static void removeAll(Node node, short nodeType); static void removeAll(Node node, short nodeType, String name); static Document cloneDocument(Document document); static String xmlToString(Node node, boolean omitXmlDeclaration); static String xmlToString(Node node); static void printDom(Node node); static String documentToText(Node node); static Set<String> getLinks(Document document, boolean inDomain, boolean outDomain, String prefix); static Set<String> getLinks(Document document, boolean inDomain, boolean outDomain, boolean subDomain); static Set<String> getLinks(Document document, boolean inDomain, boolean outDomain, String prefix, boolean respectNoFollow, boolean includeSubdomains); static Set<String> getLinks(Document document, String originalDocumentUrl, boolean inDomain, boolean outDomain, String prefix, boolean respectNoFollow, boolean includeSubdomains); static Set<String> getLinks(Document document, boolean inDomain, boolean outDomain); static String getDocumentTextDump(Document document); static List<Node> getAllSiblings(Node node);  }### Answer:
@Test public void testCountTags() { assertEquals(4, HtmlHelper.countTags("everybody is <b>here</b> to do some <p>work</p>")); assertEquals(4, HtmlHelper.countTags("<br />everybody is <b>here</b> to do some <p>work")); assertEquals(4, HtmlHelper.countTags("<br />everybody<br /> is <b>here</b> to do some <p>work", true)); assertEquals(7, HtmlHelper.countTags("<br /><a>abc</a>everybody<br /> is <b>here</b> to do some <p>work")); assertEquals(6, HtmlHelper.countTags( "<br /><a>abc</a>everybody<br /> is <b>here</b> to do some <a>abc</a> <p>work", true)); }