ExternalProjectsStateProvider () { return new ExternalProjectsStateProvider() { @Override public List<TasksActivation> getAllTasksActivation() { List<TasksActivation> result = new SmartList<>(); Map<String, ProjectSystemId> systemIds = ExternalSystemApiUtil.getAllManagers().stream() .collect(Collectors.toMap(o -> o.getSystemId().getId(), o -> o.getSystemId())); for (Map.Entry<String, ExternalProjectsState.State> systemState : myState.getExternalSystemsState().entrySet()) { ProjectSystemId systemId = systemIds.get(systemState.getKey()); if (systemId == null) continue; for (Map.Entry<String, TaskActivationState> activationStateEntry : systemState.getValue().getExternalSystemsTaskActivation() .entrySet()) { result.add(new TasksActivation(systemId, activationStateEntry.getKey(), activationStateEntry.getValue())); } } return result; } @Override public TaskActivationState getTasksActivation(@NotNull ProjectSystemId systemId, @NotNull String projectPath) { return myState.getExternalSystemsState().get(systemId.getId()).getExternalSystemsTaskActivation().get(projectPath); } @Override public Map<String, TaskActivationState> getProjectsTasksActivationMap(final @NotNull ProjectSystemId systemId) { return myState.getExternalSystemsState().get(systemId.getId()).getExternalSystemsTaskActivation(); } }; }