@Override
    public Object convert(String value) {
        if (value == null || value.isEmpty()) {
            return 0;
        }

        return value.split(splitByEscaped).length;
    }
@Test
    public void testConvert() throws Exception {
        assertEquals(0, new SplitAndCountConverter(config("x")).convert(""));
        assertEquals(1, new SplitAndCountConverter(config("_")).convert("foo-bar-baz"));
        assertEquals(1, new SplitAndCountConverter(config("-")).convert("foo"));
        assertEquals(2, new SplitAndCountConverter(config("-")).convert("foo-bar"));
        assertEquals(3, new SplitAndCountConverter(config("-")).convert("foo-bar-baz"));
        assertEquals(3, new SplitAndCountConverter(config(".")).convert("foo.bar.baz")); // Regex. Must be escaped.
    }