title: How to JMockIt System.getenv(String)?
body: <h2>What I have right now</h2>
  
  <p>I have a 3rd party singleton instance that my class under test relies on and that singleton is using <code>System.getenv(String)</code> in its constructor. Is it possible to mock this call?</p>
  
  <p>I tried this</p>
  
  <h2>JMockIt Example</h2>
  
  <pre><code>    new Expectations()
      {
  
          System mockedSystem;
          {
              System.getenv( "FISSK_CONFIG_HOME" ); returns( "." );
          }
      };
  </code></pre>
  
  <p>But it gives me an <code>EXCEPTION_ACCESS_VIOLATION</code> and crashes the JVM.</p>
  
  <p>Is there another way to set a system environment variable for a unit test?</p>