List<Module> (@NotNull Predicate<? super ProjectTaskState> predicate) { return myTasksState.entrySet().stream() .filter(entry -> entry.getKey() instanceof ModuleBuildTask) .filter(entry -> predicate.test(entry.getValue())) .map(entry -> ((ModuleBuildTask)entry.getKey()).getModule()) .collect(Collectors.toList()); }