title: How to mock a new Object Creation in Java
body: <p>Below is the code to be mocked:</p>
  
  <pre><code>private MultivaluedMap&lt;String, Object&gt; addAuthorizationAndCorrelationIdHeader(MultivaluedMap&lt;String, Object&gt; httpHeaders) {
      if(httpHeaders == null)
          httpHeaders = new MultivaluedHashMap&lt;&gt;();
  
          String token = new JSONWebToken().getUserInfo().getToken("SYSTEM", "JobScheduler");
  }
  </code></pre>
  
  <p>How to mock new JSONWebToken() part?</p>