Overriding generics
<p>I'm failing to create this class hirerarchy that includes a generic that is comparable. What am I missing here? This throws an error.</p>

<pre><code>public class Generics &lt;T extends Comparable&lt;T&gt;&gt; 
    extends Parent&lt;T extends Comparable&lt;T&gt;&gt; {

    ArrayList&lt;T&gt; ar;

    public Generics() {
        ar = new ArrayList&lt;&gt;();
    }

    @Override
    public void add(T elt){
        ar.add(elt);
    }
}
</code></pre>

<p>And the parent class is:</p>

<pre><code>public class Parent &lt;T extends Comparable&lt;T&gt;&gt;{
    int size =0;
    public Parent(){
        size=0;
    }

    public void add(T elt){
        size++;
    }
}
</code></pre>

<p>Try "Extract Superclass"  on the following. I tried extracting the ArrayList and the add(T elt). This is on the following config:</p>

<p>Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.7.0_07; Java HotSpot(TM) 64-Bit Server VM 23.3-b01
System: Linux version 3.2.0-30-generic running on amd64; UTF-8; en_US (nb)</p>

<pre><code>public class Generics &lt;T extends Comparable&lt;T&gt;&gt; {

    ArrayList&lt;T&gt; ar;
    int size;

    public Generics() {
        ar = new ArrayList&lt;&gt;();
        size = 0;
    }

    public void add(T elt){
        ar.add(elt);
        size++;
    }
}
</code></pre>
