Code example for TreeSet

Methods: toArray

	public String getEnvVar(String name) {
		return (String) vars.get(name);
	public String[] getEnvVarNames() {
		return (String[]) (String[]) (new TreeSet(vars.keySet())).toArray(new String[vars.size()]);
	private void load() { 
		try { 
			if (!JREUtils.isJava5OrLater()) { 
				// Mac, Linux, Solaris, etc. should be covered by this default 
				// command... 
				String command = "env";
				if (OSUtils.isWindows()) 
					command = System.getProperty("").toLowerCase().startsWith("windows 9") ? " /vars set" : "cmd.exe /vars set";
				vars = new HashMap();
				Runtime runtime = Runtime.getRuntime();
				Process process = runtime.exec(command);
				BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(process.getInputStream()));
Stop searching for code, let great code find you!  Add Codota to your java IDE