### Question:
ProcessInfo { @Nullable public String getEnvironmentVariable(@NotNull String name) { if (this.procEnv == null) { return null; } SystemInfo systemInfo = SystemInfoFactory.createJavaSystemInfo(); boolean isWindows = systemInfo.getOperatingSystemType() == OperatingSystemType.WINDOWS; return getEnvironmentVariables().get((isWindows) ? name.toUpperCase() : name); } protected  ProcessInfo();  ProcessInfo(long pid);  ProcessInfo(long pid, SigarProxy sigar); void refresh(); ProcessInfoSnapshot priorSnaphot(); ProcessInfoSnapshot freshSnapshot(); void destroy(); long getPid(); String getName(); String getBaseName(); String[] getCommandLine(); Map<String, String> getEnvironmentVariables(); @Nullable String getEnvironmentVariable(@NotNull
    String name); @Deprecated long getParentPid(); @Deprecated ProcState getState(); @Deprecated ProcExe getExecutable(); @Deprecated ProcTime getTime(); @Deprecated ProcMem getMemory(); @Deprecated ProcCpu getCpu(); @Deprecated ProcFd getFileDescriptor(); @Deprecated ProcCred getCredentials(); @Deprecated ProcCredName getCredentialsName(); @Deprecated String getCurrentWorkingDirectory(); @Deprecated boolean isRunning(); AggregateProcessInfo getAggregateProcessTree(); ProcessInfo getParentProcess(); void kill(String signalName); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testGetEnvironmentVariableWithNullEnv() throws Exception { assertEquals(processInfo.getEnvironmentVariable("anyvar"), null); }
@Test public void testGetEnvironmentVariable() throws Exception { Map<String, String> env = new HashMap<String, String>(); env.put("one", "1"); env.put("two", "2"); env.put("three", "3"); when(sigarProxy.getProcEnv(PID)).thenReturn(env); processInfo = new ProcessInfo(PID, sigarProxy); assertEquals(processInfo.getEnvironmentVariable("two"), "2"); }