title: "Sets" of a particular enum type with nested generics
body: <p>This is somewhat of a followup from a <a href="https://stackoverflow.com/questions/19309812/sets-of-a-particular-enum-type-but-with-generics">previous question</a> I had.</p>
  
  <p>Let's say I have an abstract parent class for animals. The same kind of animal can have different temperaments and can perform in different types of shows. So my animal definition looks something like this:</p>
  
  <pre><code>public abstract class Animal&lt;T extends Temperament, S extends Show&gt;{...}
  </code></pre>
  
  <p>I want to have trainers for various animals that are aware of the animal type, temperament, intended type of shows the animal is to perform in, AND defines a set of tricks the trainer can teach that animal. Because I want the set of tricks to be defined for a particular animal, I have an enum interface as follows:</p>
  
  <pre><code>public interface TrainingActions&lt;T extends Animal&lt;?,?&gt;&gt;{...}
  </code></pre>
  
  <p>Any enum that implements that interface defines a set of training actions for a particular animal regardless of its temperament and the shows it can perform in. </p>
  
  <p>Keeping these in mind, my definition for the parent class of trainers is as follows:</p>
  
  <pre><code>public abstract class Trainer
    &lt;A extends Animal&lt;?,?&gt;, 
     E extends Enum&lt;E&gt; &amp; TrainingActions&lt;A&gt;,
     T extends Temperament,
     S extends Show&gt;{
  ...}
  </code></pre>
  
  <p>Now, I was trying to create a concrete trainer as follows but get an error:</p>
  
  <pre><code>public class DogTrainer
    &lt;T extends Temperament,
     S extends Show&gt; extends Trainer
       &lt;Dog&lt;T,S&gt;, DogTrainer.Trainables, T, S&gt;{//error right here 
  
    public enum Trainables implements TrainingActions&lt;Dog&lt;?,?&gt;&gt;{
       FETCH, GROWL, SIT, HEEL;
    }
    ...
  }
  </code></pre>
  
  <p>I'm getting the following error with trying to use <code>DogTrainer.Trainables</code> as the parameters for <code>Trainer</code> in my definition of <code>DogTrainer</code>:</p>
  
  <pre><code>Bound mismatch: The type DogTrainer.Trainables is not a valid substitute 
  for the bounded parameter &lt;E extends Enum&lt;E&gt; &amp; TrainingActions&lt;A&gt;&gt; of the type 
  Trainer&lt;A,E,T,S&gt;
  </code></pre>
  
  <p>Can someone help me understand what I'm doing wrong?</p>