class EnvironmentUtilities {

  public static void handleServiceEnvs(Service service,
      Configuration yarnConfig, List<String> envVars) {
    if (envVars != null) {
      for (String envVarPair : envVars) {
        String key, value;
        if (envVarPair.contains(ENV_SEPARATOR)) {
          int idx = envVarPair.indexOf(ENV_SEPARATOR);
          key = envVarPair.substring(0, idx);
          value = envVarPair.substring(idx + 1);
        } else {
          LOG.warn("Found environment variable with unusual format: '{}'",
              envVarPair);
          // No "=" found so use the whole key
          key = envVarPair;
          value = "";
        }
        appendToEnv(service, key, value, ENV_VAR_DELIM);
      }
    }
    appendOtherConfigs(service, yarnConfig);
  }

  private  EnvironmentUtilities();

}