private void cleanupFinishedOperations() { List<Long> toClean = new ArrayList<>(); completedOperationIds.drainTo(toClean); if (!toClean.isEmpty()) { markOperationsCompleted(toClean); } }