### Question:
StringArrayConverter { public static String convertToString(String[] value) { if (value == null || value.length == 0) { return null; } StringBuffer result = new StringBuffer(String.valueOf(value[0])); for (int i = 1; i < value.length; i++) { result.append(",").append(value[i]); } return result.toString(); }  static String[] convertToStringArray(Object value); static String convertToString(String[] value);  }### Answer:
@Test public void testConvertToString() throws Exception { assertNull(StringArrayConverter.convertToString(null)); assertNull(StringArrayConverter.convertToString(new String[]{})); assertEquals("", StringArrayConverter.convertToString(new String[]{""})); assertEquals("foo", StringArrayConverter.convertToString(new String[]{"foo"})); assertEquals("foo,bar", StringArrayConverter.convertToString(new String[]{"foo", "bar"})); assertEquals("foo,bar,baz", StringArrayConverter.convertToString(new String[]{"foo", "bar", "baz"})); }