@Override
  public Set<RuleDescriptionSectionDto> generateSections(RulesDefinition.Rule rule) {
    Set<RuleDescriptionSectionDto> advancedSections = rule.ruleDescriptionSections().stream()
      .map(this::toRuleDescriptionSectionDto)
      .collect(Collectors.toSet());
    return addLegacySectionToAdvancedSections(advancedSections, rule);
  }
@Test
  public void generateSections_whenTwoSections_createsTwoSectionsAndDefault() {
    when(rule.ruleDescriptionSections()).thenReturn(List.of(SECTION_1, SECTION_2));

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

    assertThat(ruleDescriptionSectionDtos)
      .usingRecursiveFieldByFieldElementComparator()
      .containsExactlyInAnyOrder(EXPECTED_SECTION_1, EXPECTED_SECTION_2, LEGACY_SECTION);
  }