title: How to add a class implementing an interface to an ArrayList
body: <p>To go around having to implement ALL the methods in an interface, I created an abstract class that implements an interface, then have other classes extend the abstract class and override only the needed methods.  </p>
  
  <p><strong>I am building an API /  Framework for my app.</strong>  </p>
  
  <p>I would like to add classes that are instances of an interface <strong><code>IMyInterface</code></strong> to an <code>ArrayList</code>:  </p>
  
  <pre><code>ArrayList&lt;Class&lt;IMyInterface&gt;&gt; classes = new ArrayList&lt;&gt;();  
  classes.add(MyClass.class);  
  </code></pre>
  
  <p>Here is <strong>MyClass</strong>  </p>
  
  <pre><code>class MyClass extends AbstractIMyInterface {}  
  </code></pre>
  
  <p>Here is <strong>AbstractIMyInterface</strong>  </p>
  
  <pre><code>class AbstractIMyInterface implements IMyInterface {}  
  </code></pre>
  
  <p>So far this seems impossible. My approach above won't work:  </p>
  
  <blockquote>
    <p><code>add (java.lang.Class&lt;com.app.IMyInterface&gt;)<br>
    in ArrayList cannot be applied to<br>
    (java.lang.Class&lt;com.myapp.plugin.plugin_a.MyClass&gt;)</code>  </p>
  </blockquote>
  
  <p>How can I make this work, ie: Add a class extending another class to an <strong><code>ArrayList</code></strong></p>