@VisibleForTesting
    static List<Tuple2<ConfigGroup, String>> generateTablesForClass(
            Class<?> optionsClass, Collection<OptionWithMetaInfo> optionWithMetaInfos) {
        ConfigGroups configGroups = optionsClass.getAnnotation(ConfigGroups.class);
        List<OptionWithMetaInfo> allOptions = selectOptionsToDocument(optionWithMetaInfos);

        if (allOptions.isEmpty()) {
            return Collections.emptyList();
        }

        List<Tuple2<ConfigGroup, String>> tables;
        if (configGroups != null) {
            tables = new ArrayList<>(configGroups.groups().length + 1);
            Tree tree = new Tree(configGroups.groups(), allOptions);

            for (ConfigGroup group : configGroups.groups()) {
                List<OptionWithMetaInfo> configOptions = tree.findConfigOptions(group);
                if (!configOptions.isEmpty()) {
                    sortOptions(configOptions);
                    tables.add(Tuple2.of(group, toHtmlTable(configOptions)));
                }
            }
            List<OptionWithMetaInfo> configOptions = tree.getDefaultOptions();
            if (!configOptions.isEmpty()) {
                sortOptions(configOptions);
                tables.add(Tuple2.of(null, toHtmlTable(configOptions)));
            }
        } else {
            sortOptions(allOptions);
            tables = Collections.singletonList(Tuple2.of(null, toHtmlTable(allOptions)));
        }
        return tables;
    }
@Test
    void testOverrideDefault() {
        final String expectedTable =
                "<table class=\"configuration table table-bordered\">\n"
                        + "    <thead>\n"
                        + "        <tr>\n"
                        + "            <th class=\"text-left\" style=\"width: 20%\">Key</th>\n"
                        + "            <th class=\"text-left\" style=\"width: 15%\">Default</th>\n"
                        + "            <th class=\"text-left\" style=\"width: 10%\">Type</th>\n"
                        + "            <th class=\"text-left\" style=\"width: 55%\">Description</th>\n"
                        + "        </tr>\n"
                        + "    </thead>\n"
                        + "    <tbody>\n"
                        + "        <tr>\n"
                        + "            <td><h5>first.option.a</h5></td>\n"
                        + "            <td style=\"word-wrap: break-word;\">default_1</td>\n"
                        + "            <td>Integer</td>\n"
                        + "            <td>This is example description for the first option.</td>\n"
                        + "        </tr>\n"
                        + "        <tr>\n"
                        + "            <td><h5>second.option.a</h5></td>\n"
                        + "            <td style=\"word-wrap: break-word;\">default_2</td>\n"
                        + "            <td>String</td>\n"
                        + "            <td>This is long example description for the second option.</td>\n"
                        + "        </tr>\n"
                        + "    </tbody>\n"
                        + "</table>\n";
        final String htmlTable =
                ConfigOptionsDocGenerator.generateTablesForClass(
                                TestConfigGroupWithOverriddenDefault.class,
                                ConfigurationOptionLocator.extractConfigOptions(
                                        TestConfigGroupWithOverriddenDefault.class))
                        .get(0)
                        .f1;

        assertThat(htmlTable).isEqualTo(expectedTable);
    }