title: How do you find all subclasses of a given class in Java?
body: <p>How does one go about and try to find all subclasses of a given class (or all implementors of a given interface) in Java?
  As of now, I have a method to do this, but I find it quite inefficient (to say the least).
  The method is: </p>
  
  <ol>
  <li>Get a list of all class names that exist on the class path</li>
  <li>Load each class and test to see if it is a subclass or implementor of the desired class or interface</li>
  </ol>
  
  <p>In Eclipse, there is a nice feature called the Type Hierarchy that manages to show this quite efficiently.
  How does one go about and do it programmatically?</p>