@Test public void testSplitCapabilitiesStringEmpty() { List<BackgroundItem> list = DomainFormatUtility.splitCapabilitiesString(""); assertTrue(list.isEmpty()); }
public static List<BackgroundItem> splitCapabilitiesString(final String keywordList) { List<BackgroundItem> capabilities = new ArrayList<BackgroundItem>(); if (keywordList != null && !keywordList.isEmpty()) { String[] keywords = keywordList.replaceAll("\\s+", " ").trim().split("\\s*,(?:\\s*,)*\\s*"); for (String keyword : keywords) { if (!keyword.isEmpty()) { capabilities.add(new BackgroundItem(keyword, BackgroundItemType.CAPABILITY)); } } } return capabilities; }
DomainFormatUtility { public static List<BackgroundItem> splitCapabilitiesString(final String keywordList) { List<BackgroundItem> capabilities = new ArrayList<BackgroundItem>(); if (keywordList != null && !keywordList.isEmpty()) { String[] keywords = keywordList.replaceAll("\\s+", " ").trim().split("\\s*,(?:\\s*,)*\\s*"); for (String keyword : keywords) { if (!keyword.isEmpty()) { capabilities.add(new BackgroundItem(keyword, BackgroundItemType.CAPABILITY)); } } } return capabilities; } }
DomainFormatUtility { public static List<BackgroundItem> splitCapabilitiesString(final String keywordList) { List<BackgroundItem> capabilities = new ArrayList<BackgroundItem>(); if (keywordList != null && !keywordList.isEmpty()) { String[] keywords = keywordList.replaceAll("\\s+", " ").trim().split("\\s*,(?:\\s*,)*\\s*"); for (String keyword : keywords) { if (!keyword.isEmpty()) { capabilities.add(new BackgroundItem(keyword, BackgroundItemType.CAPABILITY)); } } } return capabilities; } private  DomainFormatUtility(); }
DomainFormatUtility { public static List<BackgroundItem> splitCapabilitiesString(final String keywordList) { List<BackgroundItem> capabilities = new ArrayList<BackgroundItem>(); if (keywordList != null && !keywordList.isEmpty()) { String[] keywords = keywordList.replaceAll("\\s+", " ").trim().split("\\s*,(?:\\s*,)*\\s*"); for (String keyword : keywords) { if (!keyword.isEmpty()) { capabilities.add(new BackgroundItem(keyword, BackgroundItemType.CAPABILITY)); } } } return capabilities; } private  DomainFormatUtility(); static List<BackgroundItem> splitCapabilitiesString(final String keywordList); static String buildCapabilitiesString(final List<BackgroundItem> items); static String buildCapabilitiesStringFromStrings(final List<String> items); }
DomainFormatUtility { public static List<BackgroundItem> splitCapabilitiesString(final String keywordList) { List<BackgroundItem> capabilities = new ArrayList<BackgroundItem>(); if (keywordList != null && !keywordList.isEmpty()) { String[] keywords = keywordList.replaceAll("\\s+", " ").trim().split("\\s*,(?:\\s*,)*\\s*"); for (String keyword : keywords) { if (!keyword.isEmpty()) { capabilities.add(new BackgroundItem(keyword, BackgroundItemType.CAPABILITY)); } } } return capabilities; } private  DomainFormatUtility(); static List<BackgroundItem> splitCapabilitiesString(final String keywordList); static String buildCapabilitiesString(final List<BackgroundItem> items); static String buildCapabilitiesStringFromStrings(final List<String> items);  }