title: Is it possible to Inject Mocks in Static class
body: <p>I have static class. I am writing JUnit for one of the static method using Junit and Mockito. In that method other class level static variable's function is called. I want to mock this function call. My code is as follows,</p>
  
  <pre><code>class ABC {
      public static SomeVariable var;
  
      public static Value getSomething() {
          try {
              Value val = var.getValue();
          }
          catch (Probable exceptions) { //Handle exceptions } 
          }
      }
  }
  </code></pre>
  
  <p>In Junit I have written following to inject mock,</p>
  
  <pre><code>@Mock
  SomeVariable var;
  
  @InjectMocks
  ABC abcTest;
  
  Mockito.when(var.getValue()).thenReturn(somevalue); //Getting compilation error here 
  abcTest.getSomething();
  </code></pre>
  
  <p>While mocking var.getValue() I am getting error as 'Unhandled Exception type'
  Please suggest me how to resolve this issue.</p>