try { assertEquals(-1, StringUtils.countMatches(null, null)); throw new RuntimeException("Should have thrown a NullPointerException. "); } catch(NullPointerException npe) { }  assertEquals(0, StringUtils.countMatches("x", "") ); assertEquals(0, StringUtils.countMatches("", "") );
    public void testCountMatches() {        assertEquals(3,              StringUtils.countMatches("one long someone sentence of one", "one"));        assertEquals(0,              StringUtils.countMatches("one long someone sentence of one", "two"));        assertEquals(4,              StringUtils.countMatches("oooooooooooo", "ooo"));    }