private static void processTasks(Iterable<TaskAndWeakRefPair> tasks, TaskFilter filter,
    List<MonitoredTask> results) {
    for (TaskAndWeakRefPair task : tasks) {
      MonitoredTask t = task.get();
      if (!filter.filter(t)) {
        results.add(t.clone());
      }
    }
  }
Create a task filter according to a given filter type.
@param filter type of monitored task
@return a task filter
hbase-server/src/main/java/org/apache/hadoop/hbase/monitoring/TaskMonitor.java