void () { Map<SearchEverywhereContributor<Object>, Integer> contributorsMap = new HashMap<>(); contributorsMap.put(new ReadActionContributor("readAction1", 0, 150, Arrays.asList("ri11", "ri12", "ri13", "ri14", "ri15", "ri16")), 10); contributorsMap.put(new ReadActionContributor("readAction2", 100, 100, Arrays.asList("ri21", "ri22", "ri23", "ri24", "ri25")), 10); contributorsMap.put(new WriteActionContributor("writeAction1", 300, 50, Arrays.asList("wi11", "wi12", "wi13", "wi14")), 10); Collector collector = new Collector(); Alarm alarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, getTestRootDisposable()); SESearcher searcher = new GroupedResultsSearcher(collector, command -> alarm.addRequest(command, 0), ourEqualityProviders); ProgressIndicator progressIndicator = searcher.search(contributorsMap, "tst"); try { if (!collector.awaitFinish(4000)) { Assert.fail("Searching still haven't finished. Possible deadlock"); } Assert.assertEquals(Arrays.asList("ri11", "ri12", "ri13", "ri14", "ri15", "ri16"), collector.getFoundItems("readAction1")); Assert.assertEquals(Arrays.asList("ri21", "ri22", "ri23", "ri24", "ri25"), collector.getFoundItems("readAction2")); Assert.assertEquals(Arrays.asList("wi11", "wi12", "wi13", "wi14"), collector.getFoundItems("writeAction1")); } catch (InterruptedException ignored) { } finally { progressIndicator.cancel(); } }