@Test
    public void testSplitNormal() {

        Assert.assertArrayEquals(
                new String[]{"a", "b", "c", "d"},
                StringUtils.splitCsv("a|b|c|d", '|', null, null));

        Assert.assertArrayEquals(
                new String[]{"", "a", "b", "c", "d"},
                StringUtils.splitCsv("|a|b|c|d", '|', null, null));

        Assert.assertArrayEquals(
                new String[]{"a", "b", "c", "d", ""},
                StringUtils.splitCsv("a|b|c|d|", '|', null, null));

        Assert.assertArrayEquals(
                new String[]{"a", "b|c", "d"},
                StringUtils.splitCsv("a|b\\|c|d", '|', '\\', null));

        Assert.assertArrayEquals(
                new String[]{"a", "b\\", "c", "d"},
                StringUtils.splitCsv("a|b\\\\|c|d", '|', '\\', null));

        Assert.assertArrayEquals(
                new String[]{"a", "b|c", "d"},
                StringUtils.splitCsv("a|\"b|c\"|d", '|', '\\', '\"'));

        Assert.assertArrayEquals(
                new String[]{"a", "|b|c|", "d"},
                StringUtils.splitCsv("a|\"|b|c|\"|d", '|', '\\', '\"'));

        Assert.assertArrayEquals(
                new String[]{"a", "b\\c", "d"},
                StringUtils.splitCsv("a|\"b\\c\"|d", '|', '\\', '\"'));

        Assert.assertArrayEquals(
                new String[]{"a", "\"b", "c\"", "d"},
                StringUtils.splitCsv("a|\\\"b|c\\\"|d", '|', '\\', '\"'));
    }
Unit tests for csv splitting and concating.
inlong-sort/sort-formats/format-row/format-csv/src/test/java/org/apache/inlong/sort/formats/csv/CsvUtilsTest.java