@Test public void shouldBeAbleToTokenizeAStringWithSpacesBetweenItems() { Set<String> set = StringTokenizer.tokenize("first, second, third"); assertThat(set).contains("first", "second", "third"); }
public static Set<String> tokenize(String input) { return StringUtils.isBlank(input) ? new HashSet<String>() : new HashSet<String>(Arrays.asList(input.trim().split("\\s*,\\s*"))); }
StringTokenizer { public static Set<String> tokenize(String input) { return StringUtils.isBlank(input) ? new HashSet<String>() : new HashSet<String>(Arrays.asList(input.trim().split("\\s*,\\s*"))); } }
StringTokenizer { public static Set<String> tokenize(String input) { return StringUtils.isBlank(input) ? new HashSet<String>() : new HashSet<String>(Arrays.asList(input.trim().split("\\s*,\\s*"))); } private  StringTokenizer(); }
StringTokenizer { public static Set<String> tokenize(String input) { return StringUtils.isBlank(input) ? new HashSet<String>() : new HashSet<String>(Arrays.asList(input.trim().split("\\s*,\\s*"))); } private  StringTokenizer(); static Set<String> tokenize(String input); }
StringTokenizer { public static Set<String> tokenize(String input) { return StringUtils.isBlank(input) ? new HashSet<String>() : new HashSet<String>(Arrays.asList(input.trim().split("\\s*,\\s*"))); } private  StringTokenizer(); static Set<String> tokenize(String input);  }