title: JUnit test case failure: java.lang.AssertionError: expected null, but was:<null>
body: <p>I am using JUnit 4.12 and Jackson</p>
  
  <pre><code>@Test
  public void testFailToGetDataAsString() {
      Receipt receipt = new Receipt(null);
  
      assertNull(receipt.getDataAsString());
  }
  </code></pre>
  
  <p>The method I am testing is the following (this.data is just a null Map):</p>
  
  <pre><code>public String getDataAsString() {
      try {
          return new ObjectMapper().writeValueAsString(this.data);
      } catch (Exception e) {
          return null;
      }
  }
  </code></pre>
  
  <p>Finally I run the test and check that "null" is not "&lt; null >". </p>