title: Is it possible for equals() to return false, even if contents of two Objects are same?
body: <p>Is it possible for equals() to return false, even if contents of two Objects are same?
  If yes, how do I prove it in the below code:
  In the below example how does p1.equals(p2) result in 'false'<br>
  I know that incorrectly implemented equals() and hashcode() methods can result in this situation but wanted to know under what datasets will equality fail.                            </p>
  
  <pre><code>public class Equalitytest {
  
      public static void main(String[] args) {
  
      Person p1 = new Person("abc",12);
      Person p2 = new Person("abc",12);
  
  //Is there any way which results in  
  // assert p1.equals(p2) == false  
  //What dataset will will satisfy the assertion to false?
  
      }
  
      public class Person {
      private String name;
      private int age;
  
      public Person(String name, int age){
          this.name = name;
          this.age = age;
      }
  
      @Override
      public boolean equals(Object obj) {
          if (obj == null) {
              return false;
          }
          if (getClass() != obj.getClass()) {
              return false;
          }
          final Person other = (Person) obj;
          if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
              return false;
          }
          if (this.age != other.age) {
              return false;
          }
          return true;
      }
  
      @Override
      public int hashCode() {
          int hash = 3;
          hash = 53 * hash + (this.name != null ? this.name.hashCode() : 0);
          hash = 53 * hash + this.age;
          return hash;
      }
      }
  </code></pre>