title: How to access a private Map in JUnit using reflections?
body: <p>I have a connector class (SVNConnector) which should be junit tested. There is a private map called <code>private Map&lt;String, SVNRepository&gt; connectionMap</code> which should be accessed in JUnit, but this map doesn't have a getter method. So I have to use reflections to do that. My question is: How does that work? I tried the following:</p>
  
  <pre><code>@BeforeClass
  public static void setUpBeforeClass() throws Exception {
      svnConnector = new SVNConnector(user, pwd);
      Field connectionMapField = SVNConnector.class.getDeclaredField("connectionMap");
      connectionMapField.setAccessible(true);
  //AND NOW?
  }
  </code></pre>
  
  <p>There are not any Collection specific getters or setters to check the size of the collectionMap or similar. So how can I access it?</p>
  
  <p>Thanks. </p>