bson/src/main/org/bson/util/ClassMap.java
public static <T> List<Class<?>> getAncestry(final Class<T> clazz) {
        return ClassAncestry.getAncestry(clazz);
    }
public static <T> List<Class<?>> getAncestry(final Class<T> clazz) {
        return ClassAncestry.getAncestry(clazz);
    }
public static < T > List < Class < ? > > getAncestry ( final Class < T > clazz ) { return ClassAncestry . getAncestry ( clazz ) ; }
Helper method that walks superclass and interface graph, superclasses first, then interfaces, to compute an ancestry list. Super
types are visited left to right. Duplicates are removed such that no Class will appear in the list before one of its subtypes.

@param clazz the class to get the ancestors for
@param <T>   the type of the class modeled by this {@code Class} object.
@return a list of all the super classes of {@code clazz}, starting with the class, and ending with {@code java.lang.Object}.
Helper method that walks superclass and interface graph superclasses first then interfaces to compute an ancestry list . Super types are visited left to right . Duplicates are removed such that no Class will appear in the list before one of its subtypes .