code: public static Iterable<Type> classAndAncestors(final Type c) {
      final List<Type> workQueue = new ArrayList<>();
  
      Type clazz = c;
      workQueue.add(clazz);
      if (getRawClass(clazz).isInterface()) {
        workQueue.add(Object.class);
      }
      for (int i = 0; i < workQueue.size(); i++) {
        clazz = workQueue.get(i);
  
        if (clazz instanceof Class) {
          final Class<?> clz = (Class<?>) clazz;
          final Type sc = clz.getSuperclass();
          if (sc != null) {
            workQueue.add(sc); //c.getSuperclass());
          }
          workQueue.addAll(Arrays.asList(clz.getGenericInterfaces()));
        } else if (clazz instanceof ParameterizedType) {
          final ParameterizedType pt = (ParameterizedType) clazz;
          final Class<?> rawPt = (Class<?>) pt.getRawType();
          final Type sc = rawPt.getSuperclass();
  //        workQueue.add(pt);
  //        workQueue.add(rawPt);
          if (sc != null) {
            workQueue.add(sc);
          }
          workQueue.addAll(Arrays.asList(rawPt.getGenericInterfaces()));
        } else if (clazz instanceof WildcardType) {
          workQueue.add(Object.class); // XXX not really correct, but close enough?
        } else if (clazz instanceof TypeVariable) {
          workQueue.add(Object.class); // XXX not really correct, but close enough?
        } else {
          throw new RuntimeException(clazz.getClass() + " " + clazz + " is of unknown type!");
        }
      }
      return workQueue;
    }
docs: Given a Type, return all of the classes it extends and interfaces it implements (including the class itself).
  <p>
  Examples:
  <pre>{@code
  Integer.class -> {Integer.class, Number.class, Object.class}
  T -> Object
  ? -> Object
  HashSet<T> -> {HashSet<T>, Set<T>, Collection<T>, Object}
  FooEventHandler -> {FooEventHandler, EventHandler<Foo>, Object}
  }</pre>