private Set<Class<?>> getClassesFor(Class<?> concreteClass) {
    List<Class<?>> parents = new LinkedList<Class<?>>();
    Set<Class<?>> classes = new HashSet<Class<?>>();

    parents.add(concreteClass);

    while (!parents.isEmpty()) {
      Class<?> clazz = parents.remove(0);
      classes.add(clazz);

      Class<?> parent = clazz.getSuperclass();
      if (parent != null) {
        parents.add(parent);
      }
    }
    return classes;
  }
Flattens a class's type hierarchy into a set of Class objects.  The set will include all superclasses
(transitively), and all interfaces implemented by these superclasses.

@param concreteClass class whose type hierarchy will be retrieved.
@return {@code concreteClass}'s complete type hierarchy, flattened and uniqued.
otto/src/main/java/com/squareup/otto/Bus.java