MyNode[] (final String projectPath, final TaskActivationState tasksActivation, final MyNode parent) { return ContainerUtil.mapNotNull(Phase.values(), phase -> tasksActivation.getTasks(phase).isEmpty() ? null : new PhaseNode(projectPath, phase, tasksActivation, parent), new MyNode[]{}); }