public void testTotalMatchesChangedListener() {
SearchMatchManager manager = createMatchManager(document, model);
manager.setSearchPattern(RegExp.compile("doug"));
MatchCountListener callback = EasyMock.createMock(MatchCountListener.class);
callback.onMatchCountChanged(10);
callback.onMatchCountChanged(15);
callback.onMatchCountChanged(0);
replay(callback);
manager.getMatchCountChangedListenerRegistrar().add(callback);
LineInfo line = document.getFirstLineInfo();