protected void setupEnvironment(@NotNull Map<String, String> environment) {
    environment.clear();

    if (myParentEnvironmentType != ParentEnvironmentType.NONE && myProcessCreator == null) {
      environment.putAll(getParentEnvironment());
    }

    if (SystemInfo.isUnix && myProcessCreator == null) {
      File workDirectory = getWorkDirectory();
      if (workDirectory != null) {
        environment.put("PWD", FileUtil.toSystemDependentName(workDirectory.getAbsolutePath()));
      }
    }

    if (!myEnvParams.isEmpty()) {
      if (SystemInfo.isWindows && myProcessCreator == null) {
        Map<String, String> envVars = CollectionFactory.createCaseInsensitiveStringMap();
        envVars.putAll(environment);
        envVars.putAll(myEnvParams);
        environment.clear();
        environment.putAll(envVars);
      }
      else {
        environment.putAll(myEnvParams);
      }
    }

    EnvironmentRestorer.restoreOverriddenVars(environment);
  }
protected void setupEnvironment(@NotNull Map<String, String> environment)