List<Task> (final TaskManager myManager, String pattern, final boolean withClosed) { List<Task> tasks = new ArrayList<>(); tasks.addAll(myManager.getLocalTasks(withClosed)); tasks.addAll(ContainerUtil.filter(myManager.getCachedIssues(withClosed), task -> myManager.findTask(task.getId()) == null)); List<Task> filteredTasks = ContainerUtil.sorted(filterTasks(pattern, tasks), TaskManagerImpl.TASK_UPDATE_COMPARATOR); return filteredTasks; }