title: find all classes and interfaces a class extends or implements recursively
body: <p>I was wondering if there was an easy way of determining the complete list of Types that a Java class extends or implements recursively?</p>
  
  <p>for instance:</p>
  
  <pre><code>class Foo extends Bar implements I1, I2 {...}
  class Bar implements I3 {...}
  interface I1 extends I4, I5 {...}
  interface I2 {...}
  interface I3 {...}
  interface I4 {...}
  interface I5 {...}
  
  class ClassUtil {
      public static Set&lt;Class&lt;?&gt;&gt; getAllExtendedOrImplementedTypesRecursively(Class&lt;?&gt; clazz){
          ???
      }
  }
  
  import static org.junit.Assert.*;
  public class ClassUtilTest {
      @Test
      public void shouldEqualClasses(){
          Set&lt;Class&lt;?&gt;&gt; types = ClassUtil.getAllExtendedOrImplementedTypesRecursively(Foo.class);
          Set&lt;Class&lt;?&gt;&gt; checklist = new HashSet&lt;&gt;();
          checklist.add(Foo.class);
          checklist.add(Bar.class);
          checklist.add(I1.class);
          checklist.add(I2.class);
          checklist.add(I3.class);
          checklist.add(I4.class);
          checklist.add(I5.class);
          assertTrue(checklist.containsAll(types));
          assertTrue(types.containsAll(checklist));
      }
  }
  </code></pre>
  
  <p>Think Arquillian ShrinkWrap creation helper.</p>
  
  <p><strong>UPDATE:</strong> due to the Class object not implementing Comparable> I also need to find a way of creating a Set (or similar class) without implementing the Comparable interface (for instance, solely relying on the hashcode of the class object).</p>
  
  <p><strong>UPDATE:</strong> changed the test to use hashset. derp.</p>