class ListSplitter {

    public static String[] splitPreserveQuotes(final String quoteCharacter,
                                               final boolean trim,
                                               final String valueList) {
        final String[] split = valueList.split(",");
        final String[] result = new InnerSplitter(quoteCharacter,
                                                  trim,
                                                  split).getSplit();

        for (int i = 0; i < result.length; i++) {
            if (result[i].contains(",")) {
                result[i] = quoteCharacter + result[i] + quoteCharacter;
            }
        }

        return result;
    }

}