public static boolean superclassHierarchyContains(Class<?> haystack, Class<?> needle)
   {
      Class<?> superclass = haystack;
      while (superclass != null && superclass != needle)
      {
         superclass = superclass.getSuperclass();
      }
      return superclass == needle;
   }
public static boolean superclassHierarchyContains ( Class < ? > haystack , Class < ? > needle ) { Class < ? > superclass = haystack ; while ( superclass != null && superclass != needle ) { superclass = superclass . getSuperclass ( ) ; } return superclass == needle ; }
Search the given {@link Class} hierarchy for the specified {@link Class}.