void (CompletionParameters parameters, Consumer<? super CompletionResult> consumer, final boolean stop, CompletionSorter customSorter) { if (stop) { stopHere(); } myCompletionService.getVariantsFromContributors(parameters, myContributor, getPrefixMatcher(), new BatchConsumer<>() { @Override public void startBatch() { CompletionResultSet.this.startBatch(); } @Override public void endBatch() { CompletionResultSet.this.endBatch(); } @Override public void consume(CompletionResult result) { consumer.consume(result); } }, customSorter); }