Incompatible types - SortedSet and TreeSet
<p>When I try to compile this:</p>

<pre><code>import java.util.*;

public class NameIndex
{
    private SortedMap&lt;String,SortedSet&lt;Integer&gt;&gt; table;

    public NameIndex()
    {
        this.table = new TreeMap&lt;String,TreeSet&lt;Integer&gt;&gt;();
    }
}
</code></pre>

<p>I get:</p>

<pre><code>Incompatible types - found java.util.TreeMap&lt;java.lang.String,java.util.TreeSet&lt;java.lang.Integer&gt;&gt; but expected java.util.String,java.util.SortedSet&lt;java.lang.Integer&gt;&gt;
</code></pre>

<p>Any idea why?</p>

<p>UPDATE:
This compiles:</p>

<pre><code>public class NameIndex
{
    private SortedMap&lt;String,TreeSet&lt;Integer&gt;&gt; table;

    public NameIndex()
    {
        this.table = new TreeMap&lt;String,TreeSet&lt;Integer&gt;&gt;();
    }
}
</code></pre>
