title: JUnit 5 tests fail with usage of JMockit dependency. How to tests methods referencing static mehtods
body: <p>I am converting the unit tests written in JUnit 4 to JUnit 5. We use JMockit when a method being tested makes a call to static method.
  In JUnit 4,</p>
  
  <pre><code>@RunWith(JMockit.class)
  public class MyTest{
  
  }
  </code></pre>
  
  <p>In JUnit 5 if I add JMocket dependency in pom.xml, JUnit 5 tests which use JMockit and the ones which do not use JMockit fails with error<a href="https://i.stack.imgur.com/fzp5O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fzp5O.png" alt="enter image description here"></a></p>
  
  <pre><code>ERROR
  error java.lang.NullPointerException
    at mockit.integration.junit4.internal.RunNotifierDecorator.fireTestStarted.
  </code></pre>
  
  <p>If I remove JMockit dependency from pom.xml, the JUnit 5 tests are successful for the ones that do not use JMockit. But others fail with error,</p>
  
  <pre><code> mockit cannot be found.
  
  &lt;jmockit-version&gt;1.38&lt;/jmockit-version&gt;     
  &lt;junit-jupiter-version&gt;5.2.0&lt;/junit-jupiter-version&gt;
  &lt;maven-surefire-plugin&gt;2.21.0&lt;/maven-surefire-plugin&gt;
  &lt;junit-platform-runner-version&gt;1.2.0&lt;/junit-platform-runner-version&gt;
  &lt;junit-platform-surefire-version&gt;1.2.0&lt;/junit-platform-surefire-version&gt;
  &lt;mockito-junit-jupiter-version&gt;2.18.3&lt;/mockito-junit-jupiter-version&gt;
  
   &lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
    &lt;version&gt;${maven-surefire-plugin}&lt;/version&gt;
    &lt;configuration&gt;
     &lt;argLine&gt; javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${jmockit-version}/jmockit-${jmockit-version}.jar
                              -XX:-UseSplitVerifier -Xmx512m -XX:MaxPermSize=256m ${argLine}
     &lt;/argLine&gt;
   &lt;/configuration&gt;
  &lt;/plugin&gt;
  
  &lt;!-- Testing --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jmockit&lt;/groupId&gt;
          &lt;artifactId&gt;jmockit&lt;/artifactId&gt;
          &lt;version&gt;${jmockit-version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
          &lt;artifactId&gt;junit-jupiter-api&lt;/artifactId&gt;
          &lt;version&gt;${junit-jupiter-version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
          &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;
          &lt;version&gt;${junit-jupiter-version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.junit.platform&lt;/groupId&gt;
          &lt;artifactId&gt;junit-platform-runner&lt;/artifactId&gt;
          &lt;version&gt;${junit-platform-runner-version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
          &lt;artifactId&gt;mockito-junit-jupiter&lt;/artifactId&gt;
          &lt;version&gt;${mockito-junit-jupiter-version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>