@Override
  public Set<RuleDescriptionSectionDto> generateSections(RulesDefinition.Rule rule) {
    return getDescriptionInHtml(rule)
      .map(this::generateSections)
      .orElse(emptySet());
  }
@Test
  public void parse_md_rule_description() {
    String ruleDescription = "This is the custom rule description";
    String exceptionsContent = "This the exceptions section content";
    String askContent = "This is the ask section content";
    String recommendedContent = "This is the recommended section content";

    when(rule.markdownDescription()).thenReturn(ruleDescription + "\n"
      + "== Exceptions" + "\n"
      + exceptionsContent + "\n"
      + "== Ask Yourself Whether" + "\n"
      + askContent + "\n"
      + "== Recommended Secure Coding Practices" + "\n"
      + recommendedContent + "\n");

    Set<RuleDescriptionSectionDto> results = generator.generateSections(rule);

    Map<String, String> sectionKeyToContent = results.stream().collect(toMap(RuleDescriptionSectionDto::getKey, RuleDescriptionSectionDto::getContent));
    assertThat(sectionKeyToContent).hasSize(4)
      .containsEntry(DEFAULT_SECTION_KEY, Markdown.convertToHtml(rule.markdownDescription()))
      .containsEntry(ROOT_CAUSE_SECTION_KEY, ruleDescription + "<br/>"
        + "<h2>Exceptions</h2>"
        + exceptionsContent + "<br/>")
      .containsEntry(ASSESS_THE_PROBLEM_SECTION_KEY,"<h2>Ask Yourself Whether</h2>"
        + askContent + "<br/>")
      .containsEntry(HOW_TO_FIX_SECTION_KEY, "<h2>Recommended Secure Coding Practices</h2>"
        + recommendedContent + "<br/>");

  }