title: Assertion Error - Junit testcase
body: <p>I have the following method to which I want to test using JUnuit and Mockito. </p>
  
  <pre><code>public Map&lt;String, String&gt; getUserACLDetails(final int userId, final int networkId, final List&lt;String&gt; privilegeNames) 
  {
      final Map&lt;String, String&gt; privilegeNameValue = new HashMap&lt;&gt;();
      final Object aclDataString = cbClient.get(String.valueOf(userId));
      Map&lt;String, String&gt; aclData = null;
  
      if (null != aclDataString &amp;&amp; !aclDataString.equals(NULL)) 
      {
          aclData = gson.fromJson(aclDataString.toString(), new HashMap&lt;String, String&gt;().getClass());
      }
  
      for (String privilegeName : privilegeNames) 
      {
          String innerMapKey = String.valueOf(networkId) + UNDER_SCORE + privilegeName;
  
          if (aclData.containsKey(innerMapKey)) 
          {
              privilegeNameValue.put(privilegeName, aclData.get(innerMapKey));
          }
      }
      return privilegeNameValue;
  }
  </code></pre>
  
  <p>Following is the testcase - </p>
  
  <pre><code> public void getUserACLDetailsWithReturnValueTest() 
   {
      final int userId = 123;
      final int networkId = 525;
      List&lt;String&gt; privilegeNames = new ArrayList&lt;&gt;();
      String privilegeName = "PRIVILEGE_ACCESS_VIEW";
      String privilegeValue = "true";
      privilegeNames.add(privilegeName);
      Map&lt;String, String&gt; privilegeNameValues = new HashMap&lt;&gt;();
      privilegeNameValues.put(privilegeName,privilegeValue);
      Map&lt;String, String&gt; aclData = new HashMap&lt;&gt;();
      aclData.put(String.valueOf(networkId) + "_" + privilegeName, privilegeValue);
      privilegeName = "PRIVILEGE_ACCESS_EDIT";
      privilegeValue = "false";
      aclData.put(String.valueOf(networkId) + "_" + privilegeName, privilegeValue);
      Mockito.when(couchbaseClient.get(String.valueOf(userId))).thenReturn(aclData);
      assertEquals(privilegeNameValues, userAclDao.getUserACLDetails(userId, networkId, privilegeNames));
  }
  </code></pre>
  
  <p>But when I execute the testcase I get the following error - </p>
  
  <pre><code>java.lang.AssertionError: expected: java.util.HashMap&lt;{PRIVILEGE_CREATIVE_ACCESS_VIEW=true}&gt; but was: java.util.HashMap&lt;{PRIVILEGE_CREATIVE_ACCESS_VIEW=true}&gt;
  at org.junit.Assert.fail(Assert.java:93)
  at org.junit.Assert.failNotEquals(Assert.java:647)
  at org.junit.Assert.assertEquals(Assert.java:128)
  at org.junit.Assert.assertEquals(Assert.java:147)
  at com.zedo.nirvana.hriday.authorization.UserAclDaoCouchbaseImplTest.getUserACLDetailsWithReturnValueTest(UserAclDaoCouchbaseImplTest.java:153)
  </code></pre>
  
  <p>I am not able to understand what is going wrong here. Can anyone help.</p>