@Test public void shouldAppendNewConfigItemsAtTheEndOfExistingConfigItems() { List<ConfigDocItem> existingConfigItems = new ArrayList<>( Arrays.asList(new ConfigDocItem(null, new ConfigDocKey()), new ConfigDocItem(null, new ConfigDocKey()))); ConfigDocItem newItem = new ConfigDocItem(null, new ConfigDocKey()); ConfigDocSection configDocSection = new ConfigDocSection(); configDocSection.setSectionDetailsTitle("title"); ConfigDocItem section = new ConfigDocItem(configDocSection, null); List<ConfigDocItem> newConfigItems = Arrays.asList(newItem, section); appendConfigItemsIntoExistingOnes(existingConfigItems, newConfigItems); assertEquals(4, existingConfigItems.size()); List<ConfigDocItem> addedList = existingConfigItems.subList(2, 4); assertEquals(newItem, addedList.get(0)); assertEquals(section, addedList.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; }