@Test
public void testSplitOnString() {

  final Object[][] testParameters = new Object[][] {{"2018-06-12", "-", 0, "2018"},
      {"2019.07.14", ".", 1, "07"}, {"2020/08/16", "/", 2, "16"}};
  assertNull(StringUtils.split(null, null, -1));
  assertNull(StringUtils.split(null, null, 0));
  assertNull(StringUtils.split(null, null, 3));
  assertNull(StringUtils.split("2021_09_18", null, -1));
  assertNull(StringUtils.split("2021_09_18", null, 0));
  assertNull(StringUtils.split("2021_09_18", null, 3));
  assertNull(StringUtils.split(null, "_", -1));
  assertNull(StringUtils.split(null, "_", 0));
  assertNull(StringUtils.split(null, "_", 3));
  assertNull(StringUtils.split("2021_09_18", "_", -1));
  assertNull(StringUtils.split("2021_09_18", "_", 3));
  for (final Object[] testParameter : testParameters) {
    String expected = (String) testParameter[3];
    String string = (String) testParameter[0];
    String delimiter = (String) testParameter[1];
    int index = (Integer) testParameter[2];
    assertEquals(expected, StringUtils.split(string, delimiter, index));
  }
}