void () { myEventsProcessor.onFinishTesting(); final Marker finishedMarker = new Marker(); myEventsProcessor.addEventsListener(new SMTRunnerEventsAdapter(){ @Override public void onTestingFinished(@NotNull SMTestProxy.SMRootTestProxy testsRoot) { finishedMarker.set(); } }); myEventsProcessor.onFinishTesting(); assertFalse(finishedMarker.isSet()); }