title: Objects.equals and Object.equals
body: <p>I try to create a tuple class that allows a tuple-like structure in Java. The general type for two elements in tuple are X and Y respectively. I try to override a correct equals for this class.</p>
  
  <p>Thing is, I know Object.equals falls into default that it still compares based on references like "==", so I am not so sure I can use that. I looked into Objects and there is an equals() in it. Does this one still compare on references, or it compares on contents? </p>
  
  <p>Quickly imagined the return statement as something like:</p>
  
  <pre><code>return Objects.equals(compared.prev, this.prev) &amp;&amp; Objects.equals(compared.next, this.next);
  </code></pre>
  
  <p>where prev and next are elements of tuple. Would this work?</p>