title: Comparator for Optional<T>
body: <p>I have <code>abstract class OptionalComparator&lt;T extends Comparable&lt;T&gt;&gt; implements Comparator&lt;Optional&lt;T&gt;&gt;</code></p>
  
  <p>So far, so good.</p>
  
  <p>Following the model used by Optional itself, I figured it would be best to have a single instance of this class, and cast it when necessary (for example, to <code>OptionalComparator&lt;Integer&gt;</code>).</p>
  
  <p>So I made <code>private static final OptionalComparator&lt;? extends Comparable&lt;?&gt;&gt; ABSENT_FIRST</code>.</p>
  
  <p>The trouble came when I tried to assign a value.  What should the type be?</p>
  
  <p><code>new OptionalComparator&lt;Comparable&lt;Object&gt;&gt;() {...}</code> doesn't work.</p>
  
  <p><code>new OptionalComparator&lt;Comparable&lt;Comparable&lt;Object&gt;&gt;&gt;() {...}</code> doesn't work.</p>
  
  <p><code>new OptionalComparator&lt;Integer&gt;() {...}</code> does work, for example, but I want the least-specific type possible.</p>
  
  <p>What am I doing wrong?  How can I make a base-case instance of this class?</p>