Create an environment by merging the current environment and the supplied one.
If the supplied environment is null, null is returned.
@param environment
@return an execution environment
487708
public static Map<String, String> createEnvironment(Map<String, String> environment)
    {
        Map<String, String> result = null;
        
        try
        {
            result = EnvironmentUtils.getProcEnvironment();
        }
        catch (IOException ex)
        {
            throw new ElasticsearchSetupException(
                    "Cannot get the current process environment", ex);
        }
        
        // Clean up the base environment:

        // The elasticsearch start and plugin scripts print warnings if these environment variables
        // are set, so lets unset them.
        result.remove("JAVA_TOOL_OPTIONS");
        result.remove("JAVA_OPTS");

        // The following environment variables may interfere with the elasticsearch instance.
        result.remove("ES_HOME");
        result.remove("ES_JAVA_OPTS");
        result.remove("ES_PATH_CONF");
        result.remove("ES_TMPDIR");

        // Now that we have a clean environment, set the provided variables on it.
        if (environment != null)
        {
            result.putAll(environment);
        }

        return result;
    }
304449
public static LocationEngineResult create(Location location) {
    checkNotNull(location, "location can't be null");
    List<Location> locations = new ArrayList<>();
    locations.add(location);
    return new LocationEngineResult(locations);
  }
1271472
public static Environment getEnvironment(Map<String,Object> properties)
    {
        if (gEnv == null)	// TODO(don) Possible concurrency issue
            gEnv = new Environment(properties); // Create the Environment (using defalt database(s))
        //+else
        //+	Utility.getLogger().warning("getEnvironmentCalled");
        return gEnv;
    }
194331
def merge(other)
      result = Env.new
      result.env = @env.merge(other.env)
      return result
    end
927951
private JavacEnvironment createEnvironment(String path, String source) throws IOException {
    List<JavaFileObject> inputFiles = new ArrayList<>();
    inputFiles.add(filterJavaFileObject(MemoryFileObject.createJavaFile(path, source)));
    return createEnvironment(Collections.emptyList(), inputFiles, false);
  }
279070
public Launcher addEnvironmentVariable(final String key, final String value) {
        env.put(key, value);
        return this;
    }
621526
public void setEnvironments(java.util.Collection<EnvironmentDescription> environments) {
        if (environments == null) {
            this.environments = null;
            return;
        }

        this.environments = new com.amazonaws.internal.SdkInternalList<EnvironmentDescription>(environments);
    }
678311
public String env(String key, String defaultValue) {
        return this.environment.get(key, defaultValue);
    }
26912
@ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
    @JoinColumn(name="ENVIRONMENT_TYPE_ID")
    public EnvironmentType getEnvironmentType()
    {
        return envType;
    }
962263
public static EnvironmentClassLoader create(ClassLoader parent)
  {
    String id = null;
    
    return create(parent, id);
  }
357288
@Override @SuppressWarnings("unchecked")
  public <T extends CMAResource> T setEnvironmentId(String environmentId) {
    return (T) setId(environmentId);
  }
1089780
public ServiceCall<Environment> getEnvironment(GetEnvironmentOptions getEnvironmentOptions) {
    Validator.notNull(getEnvironmentOptions, "getEnvironmentOptions cannot be null");
    String[] pathSegments = { "v1/environments" };
    String[] pathParameters = { getEnvironmentOptions.environmentId() };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
        pathParameters));
    builder.query("version", versionDate);
    Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getEnvironment");
    for (Entry<String, String> header : sdkHeaders.entrySet()) {
      builder.header(header.getKey(), header.getValue());
    }
    builder.header("Accept", "application/json");
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Environment.class));
  }
40400
public Environment environment(String name, Project project) {
        return environment(name, project, null);
    }
228502
public static function createFromEnvironment(Environment $environment)
    {
        $data = [];
        $environment = self::determineAuthorization($environment);
        foreach ($environment as $key => $value) {
            $key = strtoupper($key);
            if (isset(static::$special[$key]) || strpos($key, 'HTTP_') === 0) {
                if ($key !== 'HTTP_CONTENT_LENGTH') {
                    $data[$key] =  $value;
                }
            }
        }

        return new static($data);
    }
386568
private Environment switchEnvironment(Environment env) {
    Environment prev = currentEnvironment;
    currentEnvironment = env;
    return prev;
  }
612384
@Override
    public void buildEnvironment(Run<?,?> build, EnvVars env) {
        env.put(name,value);
        env.put(name.toUpperCase(Locale.ENGLISH),value); // backward compatibility pre 1.345
    }
1352052
public static Environment of(@NonNull String location) {
        if (location.startsWith(PREFIX_CLASSPATH)) {
            location = location.substring(PREFIX_CLASSPATH.length());
            return loadClasspath(location);
        } else if (location.startsWith(PREFIX_FILE)) {
            location = location.substring(PREFIX_FILE.length());
            return of(new File(location));
        } else if (location.startsWith(PREFIX_URL)) {
            location = location.substring(PREFIX_URL.length());
            try {
                return of(new URL(location));
            } catch (MalformedURLException e) {
                log.error("", e);
                return null;
            }
        } else {
            return loadClasspath(location);
        }
    }