class StringUtils {

    public static String[] splitWithCommaOrSemicolon(String src) {
        if (isEmpty(src)) {
            return StringUtils.EMPTY_STRING_ARRAY;
        }
        String[] ss = split(src.replace(',', ';'), ";");
        List<String> list = new ArrayList<String>();
        for (String s : ss) {
            if (!isBlank(s)) {
                list.add(s.trim());
            }
        }
        return list.toArray(new String[list.size()]);
    }

}

class StringUtilsTest {

    @Test
    public void testSplitWithCommaOrSemicolon() throws Exception {

        String[] s = StringUtils.splitWithCommaOrSemicolon(null);
        Assert.assertTrue(CommonUtils.isEmpty(s));

        s = StringUtils.splitWithCommaOrSemicolon("");
        Assert.assertTrue(CommonUtils.isEmpty(s));

        s = StringUtils.splitWithCommaOrSemicolon("1");
        Assert.assertNotNull(s);
        Assert.assertEquals(s.length, 1);

        s = StringUtils.splitWithCommaOrSemicolon("1,");
        Assert.assertNotNull(s);
        Assert.assertEquals(s.length, 1);

        s = StringUtils.splitWithCommaOrSemicolon(" 1,");
        Assert.assertNotNull(s);
        Assert.assertEquals(s.length, 1);

        s = StringUtils.splitWithCommaOrSemicolon(" 1,2");
        Assert.assertNotNull(s);
        Assert.assertEquals(s.length, 2);

        s = StringUtils.splitWithCommaOrSemicolon(" 1;2");
        Assert.assertNotNull(s);
        Assert.assertEquals(s.length, 2);
    }

}