StringToStringArrayConverter implements Converter<String, String[]> { public String[] convert(String source) { return source.trim().split(regexSplitter); }  String[] convert(String source); String getRegexSplitter(); void setRegexSplitter(String regexSplitter);  }
@Test public void testSplitWithoutWhitespace() { StringToStringArrayConverter converter= new StringToStringArrayConverter(); String[] result = converter.convert("a,b,c"); Assert.assertArrayEquals(new String[]{"a","b","c"}, result); }
@Test public void testSplitWithWhitespace() { StringToStringArrayConverter converter= new StringToStringArrayConverter(); String[] result = converter.convert(" \n a, b\t,\nc \n \t "); Assert.assertArrayEquals(new String[]{"a","b","c"}, result); }