title: Referencing a private class in JUnit
body: <p>I have a scenario where I want to reference a <strong>private</strong> <code>class</code> - not test that class.</p>
  
  <p>I am using Spring <code>JDBCTemplate</code> to query <code>db</code> and using a row mapper (which is <strong>private</strong> class of dao) for mapping the <code>resultset</code> to my <code>object</code>. </p>
  
  <p>Test case is mocking like 
  <code>when(dao.method(query, rowmapper, param)).thenReturn(something)</code></p>
  
  <p><strong>Possible solutions</strong>: Make rowmapper default access and keep test case in the same package. </p>
  
  <p>However my belief is that why to make code changes for the sake of <strong>test cases</strong>? </p>
  
  <p>I was wondering if <code>Java reflection</code> can be of any use in this or not ?
   I couldn't find any thing on that so if someone has already been through such thing then please share.</p>