@Test public void parseLabelsComplex() { Set<String> values = DomainUtil.parseLabels("A,B , C, , D"); assertNotNull(values); assertEquals(4, values.size()); Iterator<String> it = values.iterator(); assertEquals("A", it.next()); assertEquals("B", it.next()); assertEquals("C", it.next()); assertEquals("D", it.next()); }
public static Set<String> parseLabels(String label) { String[] labels; if (label.contains(",")) { labels = label.split(","); } else { labels = new String[1]; labels[0] = label; } return Arrays.asList(labels).stream() .map(l -> l.trim()) .filter(l -> !l.isEmpty()) .collect(Collectors.toSet()); }
DomainUtil { public static Set<String> parseLabels(String label) { String[] labels; if (label.contains(",")) { labels = label.split(","); } else { labels = new String[1]; labels[0] = label; } return Arrays.asList(labels).stream() .map(l -> l.trim()) .filter(l -> !l.isEmpty()) .collect(Collectors.toSet()); } }
DomainUtil { public static Set<String> parseLabels(String label) { String[] labels; if (label.contains(",")) { labels = label.split(","); } else { labels = new String[1]; labels[0] = label; } return Arrays.asList(labels).stream() .map(l -> l.trim()) .filter(l -> !l.isEmpty()) .collect(Collectors.toSet()); }  }
DomainUtil { public static Set<String> parseLabels(String label) { String[] labels; if (label.contains(",")) { labels = label.split(","); } else { labels = new String[1]; labels[0] = label; } return Arrays.asList(labels).stream() .map(l -> l.trim()) .filter(l -> !l.isEmpty()) .collect(Collectors.toSet()); }  static String formatLabels(Link link); static String formatLabels(Set<String> labels); static Set<String> parseLabels(String label); }
DomainUtil { public static Set<String> parseLabels(String label) { String[] labels; if (label.contains(",")) { labels = label.split(","); } else { labels = new String[1]; labels[0] = label; } return Arrays.asList(labels).stream() .map(l -> l.trim()) .filter(l -> !l.isEmpty()) .collect(Collectors.toSet()); }  static String formatLabels(Link link); static String formatLabels(Set<String> labels); static Set<String> parseLabels(String label);  }