title: Junit private fields
body: <p>Here is an existing class and its method I am trying to mock:</p>
  
  <pre><code>public class ClassUndertest{
  
     private Object field_private = new Object();
  
     public Object method_public()
     {
         field_private.method();
         method_private();
     }
  
  
     private Object method_private()
     {
         ....
         return Object;
     }
  
  }
  </code></pre>
  
  <p>My tests partially mocks ClassUndertest:</p>
  
  <pre><code>   ClassUndertest partialmockinstance = PowerMock.createPartialMock(ClassUndertest.class, "method_private");
  </code></pre>
  
  <p>When I run mock object:</p>
  
  <pre><code> partialmockinstance.method_public();
  </code></pre>
  
  <p>field_private is not intialized and so test throws null pointer.</p>
  
  <p>Is there anyway to circumvent this issue?</p>