protected void assertMarkers(String expectedBugType,int expectedBugTypeCount,IMarker[] markers) throws CoreException {
  int seenBugTypeCount=0;
  for (int i=0; i < markers.length; i++) {
    IMarker marker=markers[i];
    if (expectedBugType.equals(marker.getAttribute(FindBugsMarker.BUG_TYPE))) {
      seenBugTypeCount++;
    }
  }
  assertEquals("Expected " + expectedBugTypeCount + " of markers "+ expectedBugType+ " but seen "+ seenBugTypeCount,expectedBugTypeCount,seenBugTypeCount);
}

protected void assertMarkers ( String expectedBugType , int expectedBugTypeCount , IMarker [ ] markers ) throws CoreException { int seenBugTypeCount = 0 ; for ( int i = 0 ; i < markers . length ; i ++ ) { IMarker marker = markers [ i ] ; if ( expectedBugType . equals ( marker . getAttribute ( FindBugsMarker . BUG_TYPE ) ) ) { seenBugTypeCount ++ ; } } assertEquals ( "Expected " + expectedBugTypeCount + " of markers " + expectedBugType + " but seen " + seenBugTypeCount , expectedBugTypeCount , seenBugTypeCount ) ; }
asserts that the number of present markers of the given type match the given expected count .
