title: Junit - AssertArrayEquals is not working for user definded object (Non-Primitive data type)
body: <p><code>assertArrayEquals</code> is not working for user defined class.</p>
  
  <p>I have <code>User</code> class which has <code>name</code> property alone. When I create an array objects (actual &amp; expected) for <code>User</code> class and try to test with <code>assertArrayEquals</code>, the test fails. </p>
  
  <p>I am getting below error </p>
  
  <pre><code>arrays first differed at element [0]; expected:&lt;cts.Learning.User@3fa77460&gt; but was:&lt;cts.Learning.User@619a5dff&gt;"
  </code></pre>
  
  <p>I am using Junit - 4.12 and Hamcrest-all 1.3 version.</p>
  
  <pre><code>public class User {
      private String name;
      public User(){} 
      public User(String name) {
          this.name = name;       
      }   
      public String getName(){
          return name;
      }   
      public void setName(String name) {
          this.name = name;
      }
  }
  
  import org.junit.*;
  import static org.junit.Assert.*;
  
  public class UserJunit {
  
      @Test
      public void testUserBO() {          
          User[] expected = new User[2];      
          expected[0] = new User("A");
          expected[1] = new User("B");
  
          User[] actual = new User[2];
          actual[0] = new User("A");
          actual[1] = new User("B");  
          assertArrayEquals(actual, expected);
      }
  }
  </code></pre>