public static String[] convertToStringArray(Object value) {
        if (value == null) {
            return null;
        }

        String text = value.toString();
        if (text == null || text.length() == 0) {
            return null;
        }

        StringTokenizer stok = new StringTokenizer(text, ",");
        final List<String> list = new ArrayList<String>();

        while (stok.hasMoreTokens()) {
            list.add(stok.nextToken());
        }

        String[] array = list.toArray(new String[list.size()]);
        return array;
    }
@Test
    public void testConvertToStringArray() throws Exception {
        assertNull(StringArrayConverter.convertToStringArray(null));
        assertNull(StringArrayConverter.convertToStringArray(""));

        String[] array = StringArrayConverter.convertToStringArray("foo");
        assertEquals(1, array.length);
        assertEquals("foo", array[0]);

        array = StringArrayConverter.convertToStringArray("foo,bar");
        assertEquals(2, array.length);
        assertEquals("foo", array[0]);
        assertEquals("bar", array[1]);

        array = StringArrayConverter.convertToStringArray("foo,bar,baz");
        assertEquals(3, array.length);
        assertEquals("foo", array[0]);
        assertEquals("bar", array[1]);
        assertEquals("baz", array[2]);
    }