void (RangeSearch.EdtRangeSearchEventsListener listener) { myNeedToAbortSearch = false; myRangeSearch.removeEdtRangeSearchEventsListener(listener); myRangeSearch.addEdtRangeSearchEventsListener(new RangeSearch.EdtRangeSearchEventsListener() { @Override public void onSearchStopped() { Assert.fail("Was called onSearchStopped(), however shouldn't be"); } @Override public void onSearchFinished() { onFinished(); } }); myFindFurtherAction.actionPerformed(ActionUtil.createEmptyEvent()); }