Create group hierarchy based on {@link InfrastructureConfig} instance.<br>
Existing groups are not override!

@param configs group hierarchy configs
@return OperationFuture wrapper for list of root groups in each data center
514930
public OperationFuture<List<Group>> defineInfrastructure(InfrastructureConfig... configs) {
        checkNotNull(configs, "array of InfrastructureConfig must be not null");

        Arrays.asList(configs).stream()
            .map(InfrastructureConfig::getAlertPolicies)
            .flatMap(List::stream)
            .forEach(alertConfig -> {
                    List<AlertPolicyMetadata> policies = policyService.alert().find(
                        new AlertPolicyFilter().names(alertConfig.getName())
                    );

                    if (policies.size() == 0) {
                        policyService.alert().create(alertConfig).waitUntilComplete();
                    }
            }
        );

        List<OperationFuture<Group>> operationFutures = Arrays.asList(configs).stream()
            .map(cfg ->
                cfg.getDataCenters().stream()
                    .map(dc -> {
                            defineAntiAffinityPolicies(dc, cfg.getAntiAffinityPolicies());

                            return cfg.getSubitems().stream()
                                .map(subCfg -> defineGroupHierarchy(dc, subCfg))
                                .collect(toList());
                        }
                    )
                    .collect(toList())
            )
            .flatMap(List::stream)
            .flatMap(List::stream)
            .collect(toList());

        List<Group> groups = operationFutures.stream()
            .map(OperationFuture::getResult)
            .collect(toList());

        List<JobFuture> futures = operationFutures.stream()
            .map(OperationFuture::jobFuture)
            .collect(toList());

        return new OperationFuture<>(groups, new ParallelJobsFuture(futures));
    }
206330
public OperationFuture<List<Server>> pause(Group... groups) {
        return serverService().pause(
            getServerSearchCriteria(groups)
        );
    }
519484
public OperationFuture<List<Network>> update(List<Network> networkList, UpdateNetworkConfig config) {
        networkList.forEach(network -> update(network, config));

        return new OperationFuture<>(networkList, new NoWaitingJobFuture());
    }
219715
final protected function processConfiguration(array $configs)
    {
        $processor = new Processor();

        return $processor->process(self::$configTree->buildTree(), $configs);
    }
933756
public static List<Setting> groupsToSettings(List<Group> groups) {
    return groups.stream()
        .map(Group::getSettings)
        .flatMap(Collection::stream)
        .collect(Collectors.toList());
  }
458313
public OperationFuture<Network> update(Network network, UpdateNetworkConfig config) {
        NetworkMetadata networkMetadata = findByRef(network);

        networkClient.update(
            networkMetadata.getDataCenterId(),
            networkMetadata.getId(),
            new UpdateNetworkRequest()
                .name(config.getName())
                .description(config.getDescription())
        );

        return new OperationFuture<>(network, new NoWaitingJobFuture());
    }
1260718
public void setGroups(java.util.Collection<ReservationUtilizationGroup> groups) {
        if (groups == null) {
            this.groups = null;
            return;
        }

        this.groups = new java.util.ArrayList<ReservationUtilizationGroup>(groups);
    }
6812
@Nonnull
  private static CalendarHierarchy _createConfigurationHierarchy (@Nonnull final Configuration aConfig,
                                                                  @Nullable final CalendarHierarchy aParent)
  {
    final ECountry eCountry = ECountry.getFromIDOrNull (aConfig.getHierarchy ());
    final CalendarHierarchy aHierarchy = new CalendarHierarchy (aParent, aConfig.getHierarchy (), eCountry);
    for (final Configuration aSubConfig : aConfig.getSubConfigurations ())
    {
      final CalendarHierarchy aSubHierarchy = _createConfigurationHierarchy (aSubConfig, aHierarchy);
      aHierarchy.addChild (aSubHierarchy);
    }
    return aHierarchy;
  }
202755
public OperationFuture<List<Group>> delete(Group... groups) {
        List<Group> groupList = Arrays.asList(groups);

        List<JobFuture> jobs = groupList.stream()
            .map(group -> delete(group).jobFuture())
            .collect(toList());

        return new OperationFuture<>(
            groupList,
            new ParallelJobsFuture(jobs)
        );
    }
376968
public OperationFuture<List<Server>> powerOn(Group... groups) {
        return serverService().powerOn(
            getServerSearchCriteria(groups)
        );
    }
1129086
public KeePassFileBuilder addTopGroups(Group... groups) {
        for (Group group : groups) {
            rootBuilder.addGroup(group);
        }

        return this;
    }
737045
@Deprecated
    public ListGroupsResult withGroups(java.util.Collection<Group> groups) {
        setGroups(groups);
        return this;
    }
1011495
public static PrefixedProperties createCascadingPrefixProperties(final List<PrefixConfig> configs) {
		PrefixedProperties properties = null;
		for (final PrefixConfig config : configs) {
			if (properties == null) {
				properties = new PrefixedProperties((config == null) ? new DynamicPrefixConfig() : config);
			} else {
				properties = new PrefixedProperties(properties, (config == null) ? new DynamicPrefixConfig() : config);
			}
		}
		return properties;
	}
962267
public OperationFuture<List<LoadBalancer>> update(
            List<LoadBalancer> loadBalancerList,
            LoadBalancerConfig config
    ) {
        loadBalancerList.forEach(loadBalancer -> update(loadBalancer, config));

        return new OperationFuture<>(
            loadBalancerList,
            new NoWaitingJobFuture()
        );
    }
725906
public OperationFuture<Group> modify(Group groupRef, GroupConfig groupConfig) {
        checkNotNull(groupConfig, "GroupConfig must be not null");
        checkNotNull(groupRef, "Group reference must be not null");
        updateGroup(idByRef(groupRef), groupConfig);

        return new OperationFuture<>(
            groupRef,
            new NoWaitingJobFuture()
        );
    }
774164
public OperationFuture<AntiAffinityPolicy> create(AntiAffinityPolicyConfig createConfig) {
        AntiAffinityPolicyMetadata policy = client.createAntiAffinityPolicy(
            new AntiAffinityPolicyRequest()
                .name(createConfig.getName())
                .location(dataCenterService.findByRef(createConfig.getDataCenter()).getId())
        );

        return new OperationFuture<>(
            AntiAffinityPolicy.refById(policy.getId()),
            new NoWaitingJobFuture()
        );
    }
26026
@VisibleForTesting
    AbstractConfiguration createConfiguration(Properties properties) {

        CompositeConfiguration composite = new CompositeConfiguration();

        ConfigurationType[] types = ConfigurationType.values();

        Arrays.stream(types).forEach(s -> s.get().ifPresent(composite::addConfiguration));

        Optional.ofNullable(properties).ifPresent(p -> composite.addConfiguration(new MapConfiguration(p)));

        return composite;

    }