public static int getOcuranceString( String string, String searchFor ) {
    if ( string == null || string.length() == 0 ) {
      return 0;
    }
    Pattern p = Pattern.compile( searchFor );
    Matcher m = p.matcher( string );
    int count = 0;
    while ( m.find() ) {
      ++count;
    }
    return count;
  }
@Test
  public void testGetOcuranceString() {
    assertEquals( 0, Const.getOcuranceString( "", "" ) );
    assertEquals( 0, Const.getOcuranceString( "foo bar bazfoo", "cat" ) );
    assertEquals( 2, Const.getOcuranceString( "foo bar bazfoo", "foo" ) );
  }