docs: private static void setEnv(Map<String, String> newEnv, boolean overwrite) {
  
  		for (Entry<String, String> entry : newEnv.entrySet()) {
  			if (overwrite || System.getProperty(entry.getKey()) != null) {
  				System.setProperty(entry.getKey(), entry.getValue());
  			}
  		}
  
  		if (!overwrite) {
  			Iterator<Entry<String, String>> iterator = newEnv.entrySet().iterator();
  			while (iterator.hasNext()) {
  				Entry<String, String> next = iterator.next();
  				if (System.getenv(next.getKey()) != null) {
  					iterator.remove();
  				}
  			}
  		}
  
  		try {
  			Class<?> processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment");
  			Method variableMethod = Class.forName("java.lang.ProcessEnvironment$Variable").getMethod("valueOf", String.class);
  			variableMethod.setAccessible(true);
  			Method valueMethod = Class.forName("java.lang.ProcessEnvironment$Value").getMethod("valueOf", String.class);
  			valueMethod.setAccessible(true);
  
  			Map<Object, Object> newEnvVarVal = new HashMap<Object, Object>();
  			for (Map.Entry<String, String> entry : newEnv.entrySet()) {
  				Object key = variableMethod.invoke(null, entry.getKey());
  				String valueText = entry.getValue();
  				Object value = valueText != null ? valueMethod.invoke(null, valueText) : null;
  				newEnvVarVal.put(key, value);
  			}
  
  			Field theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment");
  			theEnvironmentField.setAccessible(true);
  			Map<Object, Object> env = (Map<Object, Object>) theEnvironmentField.get(null);
  			for (Entry<Object, Object> entry : newEnvVarVal.entrySet()) {
  				if (entry.getValue() == null) {
  					env.remove(entry.getKey());
  				} else {
  					env.put(entry.getKey(), entry.getValue());
  				}
  			}
  			Field theCaseInsensitiveEnvironmentField = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
  			theCaseInsensitiveEnvironmentField.setAccessible(true);
  			Map<Object, Object> cienv = (Map<Object, Object>) theCaseInsensitiveEnvironmentField.get(null);
  			cienv.putAll(newEnvVarVal);
  
  		} catch (NoSuchFieldException e) {
  			try {
  				Class[] classes = Collections.class.getDeclaredClasses();
  				Map<String, String> env = System.getenv();
  				for (Class cl : classes) {
  					if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
  						Field field = cl.getDeclaredField("m");
  						field.setAccessible(true);
  						Object obj = field.get(env);
  						Map<String, String> map = (Map<String, String>) obj;
  						for (Entry<String, String> entry : newEnv.entrySet()) {
  							if (entry.getValue() == null) {
  								map.remove(entry.getKey());
  							} else {
  								map.put(entry.getKey(), entry.getValue());
  							}
  						}
  					}
  				}
  			} catch (Exception e2) {
  				LOGGER.error(e2.getMessage(), e2);
  			}
  		} catch (Exception e1) {
  			LOGGER.error(e1.getMessage(), e1);
  		}
  	}