private TaskProgress buildFilteredTaskProgress(
            final long timeNowMs,
            final TaskContextImpl taskContext,
            final Predicate<TaskProgress> fuzzyMatchPredicate) {
        final TaskProgress taskProgress = buildTaskProgress(timeNowMs, taskContext);

        // Because the UI needs to display the ancestors of filtered in tasks and the ancestor tasks
        // may exist on another node, we can't just remove filtered out tasks. We need to let the UI
        // aggregate all the tasks from each node and then remove tasks that are filtered out or
        // are an ancestor of a filtered in task.
        // Filter state is worked out server side as GWT can't use the matching code due to all the
        // regex involved.
        taskProgress.setFilterMatchState(FilterMatchState.fromBoolean(fuzzyMatchPredicate.test(taskProgress)));

        return taskProgress;
    }
Tells tasks to terminate and waits for all tasks to terminate before
cleaning up the executors.
stroom-task/stroom-task-impl/src/main/java/stroom/task/impl/TaskManagerImpl.java