Runnable (CountDownLatch latch, ResultsAccumulator accumulator, ProgressIndicator indicator) { return ConcurrencyUtil.underThreadNameRunnable("SE-FinisherTask", () -> { try { latch.await(); if (!indicator.isCanceled()) { accumulator.searchFinished(); } indicator.stop(); } catch (InterruptedException e) { LOG.debug("Finisher interrupted before search process is finished"); } }); }