List<TasksActivation> () { 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; }