title: Java Comparator.comparing not comparing?
body: <p>Following <a href="https://stackoverflow.com/questions/18129807/in-java-how-do-you-sort-one-list-based-on-another">this question</a> about sorting a list by another list, I tried to do the same thing - but from some reason it doesn't work for me. What am I missing?</p>
  
  <pre><code>    List&lt;Double&gt; nums = Arrays.asList(5.0, 0.9, 10.4);
      List&lt;Double&gt; order = Arrays.asList(3.0, 1.0, 2.0);
      nums.sort(Comparator.comparing(order::indexOf));
      System.out.println(nums);
  
      OUTPUT: [5.0, 0.9, 10.4]
  </code></pre>
  
  <p>It should be [0.9, 10.4, 5.0] (according to <code>order</code>). What am I not doing right?</p>
  
  <p><strong>EDIT:</strong> As most of you noticed, I got answer to the question I linked to all wrong. <a href="https://stackoverflow.com/questions/56166015/order-list-by-a-related-list-in-java">Here's what I actually want to do.</a></p>