title: Junit Assertion Error for ArrayList and Arrays.asList()
body: <p>I have method which returns ArrayList of object as below - </p>
  
  <pre><code>public &lt;Range&gt; getAllRanges(List&lt;Range&gt; ranges){
    //Some business logic
    ....
    List&lt;Range&gt; resultRanges = new ArrayList&lt;&gt;();
    .....
    return resultRanges;
  }
  </code></pre>
  
  <p>I am writing Junit for this as - </p>
  
  <pre><code>@Test
  public void someInputTest() {
      final List&lt;Range&gt; ranges = Arrays.asList(new Range(1, 3), new Range(2, 4));
      final List&lt;Range&gt; actual = myCalss.getAllRanges(ranges);
      final List&lt;Range&gt; expected = Arrays.asList(new Range(1, 4));
      assertEquals(expected, actual);
  }
  </code></pre>
  
  <p>but I am getting Assertion Error like -</p>
  
  <pre><code>java.lang.AssertionError: expected: java.util.Arrays$ArrayList&lt;[(1, 4)]&gt; but was: java.util.ArrayList&lt;[(1, 4)]&gt;
  ....
  </code></pre>
  
  <p>After that I tried below code in test -</p>
  
  <pre><code>@Test
  public void someInputTest() {
      final List&lt;Range&gt; ranges = Arrays.asList(new Range(1, 3), new Range(2, 4));
      final List&lt;Range&gt; actual = myCalss.getAllRanges(ranges);
      final List&lt;Range&gt; expected = new ArrayList&lt;&gt;();
      expected.add(new Range(1, 4));
      assertEquals(expected, actual);
  }
  </code></pre>
  
  <p>but after that I am getting -</p>
  
  <pre><code>java.lang.AssertionError: expected: java.util.ArrayList&lt;[(1, 4)]&gt; but was: java.util.ArrayList&lt;[(1, 4)]&gt;
  ...
  </code></pre>
  
  <p>Now expected and actual are bot same but still assertion error. What I am doing wrong here.</p>