@Test public void shouldAppendConfigSectionConfigItemsIntoExistingConfigItemsOfConfigSectionWithSameTitle() { ConfigDocSection existingSection = new ConfigDocSection(); existingSection.setSectionDetailsTitle("title"); ConfigDocItem configItem = new ConfigDocItem(null, new ConfigDocKey()); existingSection.addConfigDocItems(Arrays.asList(configItem)); ConfigDocItem configDocItem = new ConfigDocItem(existingSection, null); List<ConfigDocItem> existingConfigItems = new ArrayList<>(Arrays.asList(configDocItem)); ConfigDocSection configDocSection = new ConfigDocSection(); configDocSection.setSectionDetailsTitle("title"); ConfigDocItem newConfigItem = new ConfigDocItem(null, new ConfigDocKey()); configDocSection.addConfigDocItems(Arrays.asList(newConfigItem)); ConfigDocItem section = new ConfigDocItem(configDocSection, null); appendConfigItemsIntoExistingOnes(existingConfigItems, Arrays.asList(section)); assertEquals(1, existingConfigItems.size()); assertEquals(2, existingSection.getConfigDocItems().size()); assertEquals(configItem, existingSection.getConfigDocItems().get(0)); assertEquals(newConfigItem, existingSection.getConfigDocItems().get(1)); }
public static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems, List<ConfigDocItem> configDocItems) { for (ConfigDocItem configDocItem : configDocItems) { if (configDocItem.isConfigKey()) { existingConfigItems.add(configDocItem); } else { ConfigDocSection configDocSection = configDocItem.getConfigDocSection(); boolean configSectionMerged = mergeSectionIntoPreviousExistingConfigItems(configDocSection, existingConfigItems); if (!configSectionMerged) { existingConfigItems.add(configDocItem); } } } }
DocGeneratorUtil { public static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems, List<ConfigDocItem> configDocItems) { for (ConfigDocItem configDocItem : configDocItems) { if (configDocItem.isConfigKey()) { existingConfigItems.add(configDocItem); } else { ConfigDocSection configDocSection = configDocItem.getConfigDocSection(); boolean configSectionMerged = mergeSectionIntoPreviousExistingConfigItems(configDocSection, existingConfigItems); if (!configSectionMerged) { existingConfigItems.add(configDocItem); } } } } }
DocGeneratorUtil { public static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems, List<ConfigDocItem> configDocItems) { for (ConfigDocItem configDocItem : configDocItems) { if (configDocItem.isConfigKey()) { existingConfigItems.add(configDocItem); } else { ConfigDocSection configDocSection = configDocItem.getConfigDocSection(); boolean configSectionMerged = mergeSectionIntoPreviousExistingConfigItems(configDocSection, existingConfigItems); if (!configSectionMerged) { existingConfigItems.add(configDocItem); } } } }  }
DocGeneratorUtil { public static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems, List<ConfigDocItem> configDocItems) { for (ConfigDocItem configDocItem : configDocItems) { if (configDocItem.isConfigKey()) { existingConfigItems.add(configDocItem); } else { ConfigDocSection configDocSection = configDocItem.getConfigDocSection(); boolean configSectionMerged = mergeSectionIntoPreviousExistingConfigItems(configDocSection, existingConfigItems); if (!configSectionMerged) { existingConfigItems.add(configDocItem); } } } }  static String computeExtensionDocFileName(String configRoot); static String computeExtensionGeneralConfigDocFileName(String configRoot); static String computeConfigGroupDocFileName(String configGroupClassName); static String computeConfigRootDocFileName(String configRootClassName, String rootName); static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems,
            List<ConfigDocItem> configDocItems); static void sort(List<ConfigDocItem> configDocItems); }
DocGeneratorUtil { public static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems, List<ConfigDocItem> configDocItems) { for (ConfigDocItem configDocItem : configDocItems) { if (configDocItem.isConfigKey()) { existingConfigItems.add(configDocItem); } else { ConfigDocSection configDocSection = configDocItem.getConfigDocSection(); boolean configSectionMerged = mergeSectionIntoPreviousExistingConfigItems(configDocSection, existingConfigItems); if (!configSectionMerged) { existingConfigItems.add(configDocItem); } } } }  static String computeExtensionDocFileName(String configRoot); static String computeExtensionGeneralConfigDocFileName(String configRoot); static String computeConfigGroupDocFileName(String configGroupClassName); static String computeConfigRootDocFileName(String configRootClassName, String rootName); static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems,
            List<ConfigDocItem> configDocItems); static void sort(List<ConfigDocItem> configDocItems); static final String LEVEL_HACK_URL; }