@Test
public void testCountMatches() {

  final Object[][] testParameters = new Object[][] {{"hello, world", 'h', 1},
      {"hello, world", 'o', 2}, {"hello, world", 'l', 3}};
  assertEquals(0, StringUtils.countMatches(null, 'a'));
  assertEquals(0, StringUtils.countMatches("", 'a'));
  assertEquals(0, StringUtils.countMatches(" ", 'a'));
  assertEquals(0, StringUtils.countMatches("\n", 'a'));
  for (final Object[] testParameter : testParameters) {
    int expected = (Integer) testParameter[2];
    String str = (String) testParameter[0];
    char ch = (Character) testParameter[1];
    assertEquals(expected, StringUtils.countMatches(str, ch));
  }
}