title: How to restrict Java generics type parameter in interface to certain classes
body: <p>I am creating a typed interface defintion and I want to restrict the possible values for the type parameter to a set of classes. These classes are existing already and are not under my control. Also, they are not related to each other through the class hierarchy. </p>
  
  <p>So, for example, I have three classes A, B, C. My interface is <code>IMyFancyInterface&lt;T&gt;</code>. 
  How can I restrict implementors of this interface and make sure that T is either A, B, or C only? 
  Thanks a lot. </p>
  
  <p>Cheers, </p>
  
  <p>Martin</p>