@Test
public void testSplitToList() throws Exception {

    String str = "d,1,2,4";
    assertEquals(4, splitToList(str, ',').size());
    assertEquals(asList(str.split(",")), splitToList(str, ','));
    assertEquals(1, splitToList(str, 'a').size());
    assertEquals(asList(str.split("a")), splitToList(str, 'a'));
    assertEquals(0, splitToList("", 'a').size());
    assertEquals(0, splitToList(null, 'a').size());
}