title: JUnit AsserEquals() failing because of extra whitespace on array
body: <p>A Junit test of mine is failing when comparing 2 arrays with kafka producer records in them. The failure is one extra space after the array.</p>
  
  <p>Expected:</p>
  
  <pre><code>java.util.ArrayList&lt;[ProducerRecord(topic=producer-test, partition=null, 
  headers=RecordHeaders(headers = [], isReadOnly = false), key=0, 
  value=Message: test-message,
  Number: 0, timestamp=null), ProducerRecord(topic=producer-test, 
  partition=null, headers=RecordHeaders(headers = [], isReadOnly = false), 
  key=1, value=Message: test-message,
  Number: 1, timestamp=null)]&gt; 
  </code></pre>
  
  <p>Actual:</p>
  
  <pre><code>java.util.ArrayList&lt;[ProducerRecord(topic=producer-test, partition=null, 
  headers=RecordHeaders(headers = [], isReadOnly = false), key=0, 
  value=Message: test-message,
  Number: 0, timestamp=null), ProducerRecord(topic=producer-test, 
  partition=null, headers=RecordHeaders(headers = [], isReadOnly = false), 
  key=1, value=Message: test-message,
  Number: 1, timestamp=null)]&gt;
  </code></pre>
  
  <p>The IDE tells me that the only difference is one space after the end of the arrayList in Expected, which you can see by highlighting the end. What is going on?!</p>
  
  <p>Edit:</p>
  
  <p>Here is some of the other code</p>
  
  <pre><code>List&lt;ProducerRecord&lt;Integer, TestObj&gt;&gt; history = producer.history();
  
      //To be inserted into expected
      TestObj obj0 = new TestObj("test-message", 0);
      TestObj obj1 = new TestObj("test-message", 1);
  
      //new arraylist is needed or else the lists have slightly different types for some reason
      List&lt;ProducerRecord&lt;Integer, TestObj&gt;&gt; expected = new ArrayList&lt;ProducerRecord&lt;Integer, TestObj&gt;&gt;(Arrays.asList(
              new ProducerRecord&lt;Integer, TestObj&gt;("producer-test", 0, obj0),
              new ProducerRecord&lt;Integer, TestObj&gt;("producer-test", 1, obj1)
      ));
  
      Assert.assertEquals("Sent didn't match expected!", expected, history);
  </code></pre>