title: Access private method having parameter with private access specifier
body: <p>I am writing a <strong>Junit</strong> for a method with multiple parameters and having <strong>private access specifier</strong>. I am using Java reflection to achieve this. However, one of the parameter for this private method is private class. I am doing below:</p>
  
  <pre><code>ClassHavingPrivateMethod object = new ClassHavingPrivateMethod();
  object.getClass().getDeclaredMethod(PRIVATE_METHOD_NAME, Param1.class, &lt;This parameter is a private class Inside ClassHavingPrivateMethod&gt;)
  </code></pre>
  
  <p>How can I proceed?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I agree on the point that I should not write a test case for a private method with reflection and it should always be accessed through a wrapper public method. However, is there any way to achieve the above objective through reflection. Even though, I am not going to write my test case through reflection but I am eager to know about it.</p>
  
  <p>Any help is really appreciated.</p>