title: Comparator comparingInt
body: <p>I need to sort a list of Points. First I need to compare the x value, then if the x values are  equal, the y value. So I thought I'd use the thenComparing method:</p>
  
  <pre><code>Comparator&lt;Point&gt; cmp = Comparator.comparingInt(p -&gt; p.x).thenComparingInt(p -&gt; p.y);
  </code></pre>
  
  <p>But I keep getting the message: Incompatible types: Comparator&lt;Object&gt; cannot be converted to Comparator&lt;Point&gt;.</p>
  
  <p>There are other ways I can make this comparison, and it works, but I don't understand what I'm doing wrong here. </p>