### Question:
TaskHelper { public static List<Task> extractTasks(TaskOrUser taskOrUser) { return extractTasks(taskOrUser, testedTask -> true); } private  TaskHelper(); static boolean isPotentialOwner(Task task, User user); static boolean hasAllLabels(Task task, User user, String labelName); static int countMatchingLabels(Task task, User user, String labelName); static List<Task> extractTasks(TaskOrUser taskOrUser); static List<Task> extractTasks(TaskOrUser taskOrUser, Predicate<Task> predicate); static boolean hasPinnedTasks(TaskOrUser user);  }### Answer:
@Test public void extractTasks() { TaskOrUser taskOrUser = buildTaskOrUser(); List<Task> result = TaskHelper.extractTasks(taskOrUser); assertThat(result.size()).isEqualTo(4); assertThat(result.get(0).getId()).isEqualTo(1); assertThat(result.get(1).getId()).isEqualTo(2); assertThat(result.get(2).getId()).isEqualTo(3); assertThat(result.get(3).getId()).isEqualTo(4); }
@Test public void extractTasksFiltered() { TaskOrUser taskOrUser = buildTaskOrUser(); List<Task> result = TaskHelper.extractTasks(taskOrUser, testedTask -> testedTask.getId() == 1 || testedTask.getId() == 4); assertThat(result.size()).isEqualTo(2); assertThat(result.get(0).getId()).isEqualTo(1); assertThat(result.get(1).getId()).isEqualTo(4); }