public static String cut(String s, String splitChar, int index) {
        if (s == null || splitChar == null || index < 0) {
            return null;
        }

        final String[] parts = s.split(Pattern.quote(splitChar));
        if (parts.length <= index) {
            return null;
        }

        return emptyToNull(parts[index]);
    }
@Test
    public void testCutChecksBounds() throws Exception {
        String result = SplitAndIndexExtractor.cut("foobar", " ", 1);

        assertNull(result);
    }