title: Mocking a class which uses static void method of another class
body: <pre><code>public class ProjectIdInitializer {
      public static void setProjectId(String projectId) {
          //load spring context which i want  to escape in my test
      }
  }
  
  public class MyService {
      public Response create(){
          ...
          ProjectIdInitializer.setProjectId("Test");
      }
  }
  
  @RunWith(PowerMockRunner.class)
  @PrepareForTest({ProjectIdInitializer.class})
  public class MyServiceTest{
      @InjectMocks
      private MyService myServiceMock ;
  
      public void testCreate() {
          PowerMockito.mockStatic(ProjectIdInitializer.class);
          PowerMockito.doNothing().when(ProjectIdInitializer.class, "setProjectId", Mockito.any(String.class));
          // Does not work,still tries to load spring context
          Response response=myServiceMock .create();
      }
  </code></pre>
  
  <p>How can i make sure that nothing happens if ProjectIdInitializer.setProjectId() is called from myservice?</p>