private void setSystemPackages(List<SystemCapability> systemCapabilities) {
   StringBuilder systemPackagesProperty = new StringBuilder();
   for (SystemCapability capability : systemCapabilities) {
     if (capability.getType() == Type.JAVA_PACKAGE) {
       final String packageName = capability.getName();
       systemPackages.add(packageName);
       append(systemPackagesProperty, toPackageSpecifier(packageName, capability.getVersion()));
     }
   }
   setPropertyIfNotEmpty(Constants.FRAMEWORK_SYSTEMPACKAGES, systemPackagesProperty);
 }
 private void setExecutionEnvironmentProperties(List<SystemCapability> systemCapabilities) {
   StringBuilder executionEnvironmentProperty = new StringBuilder();
   for (SystemCapability capability : systemCapabilities) {
     if (capability.getType() == Type.OSGI_EE) {
       String environmentName = capability.getName();
       String version = normalizeVersion(capability.getVersion());
       append(executionEnvironmentProperty, toExecutionEnvironment(environmentName, version));
     }
   }
   setPropertyIfNotEmpty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, executionEnvironmentProperty);
 }
  private void setOsgiSystemCapabilities(List<SystemCapability> systemCapabilities) {
    Map<String, MultipleVersionsCapability> capabilityMap =
        new LinkedHashMap<String, MultipleVersionsCapability>();
    for (SystemCapability capability : systemCapabilities) {
      if (capability.getType() == Type.OSGI_EE) {
        String environmentName = capability.getName();
        String version = normalizeVersion(capability.getVersion());
        if (capabilityMap.containsKey(environmentName)) {
          capabilityMap.get(environmentName).addVersion(version);
        } else {
          capabilityMap.put(
              environmentName, new MultipleVersionsCapability(environmentName, version));
        }
      }
    }

    StringBuilder systemCapabilitesProperty = new StringBuilder();
    for (String environmentName : capabilityMap.keySet()) {
      MultipleVersionsCapability capability = capabilityMap.get(environmentName);
      append(systemCapabilitesProperty, capability.toString());
    }

    setPropertyIfNotEmpty(Constants.FRAMEWORK_SYSTEMCAPABILITIES, systemCapabilitesProperty);
  }