void (CompletionProgressIndicator indicator) { ArrayList<CompletionResult> batchListCopy = new ArrayList<>(myBatchList); myBatchList.clear(); myQueue.offer(() -> { tryReadOrCancel(indicator, () -> indicator.withSingleUpdate(() -> { for (CompletionResult result : batchListCopy) { indicator.addItem(result); } })); return true; }); }