title: More elegant way of comparing Objects implementing Comparable
body: <p>I have the following objects (assuming the class Rank implements Comparable):</p>
  
  <pre><code>Rank rankA;
  Rank rankB;
  </code></pre>
  
  <hr>
  
  <p>I would compare them like this:</p>
  
  <pre><code>if(rankA.compareTo(rankB) &lt; 0) // rankA &lt; rankB
      doSomething();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if(rankA.compareTo(rankB) == 0) // rankA == rankB
      doSomething();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if(rankA.compareTo(rankB) &gt; 0) // rankA &gt; rankB
      doSomething();
  </code></pre>
  
  <hr>
  
  <p>I find the above if statements hard to read, even with the added comments. Is there a more elegant, more readable solution? I am aware that I could implement a method for this, but I am looking for a solution that's preferably already implemented, so I don't have to create a util-method.</p>