List<RangeMarker> (List<? extends RangeMarker> markers) { List<RangeMarker> unprocessed = new ArrayList<>(); for (int i = 0; i < markers.size(); i++) { myIndicator.checkCanceled(); myIndicator.setFraction(0.5 + 0.2 * i / markers.size()); RangeMarker marker = markers.get(i); if (!marker.isValid()) continue; Runnable doProcess = () -> { if (!joinNonRaw(marker)) { unprocessed.add(marker); } }; ProgressManager.getInstance().executeNonCancelableSection(doProcess); } return unprocessed; }