public static List<Class<?>> getAllSuperclasses(Class<?> cls) {
        if (cls == null) {
            return null;
        }
        List<Class<?>> classes = new ArrayList<Class<?>>();
        Class<?> superclass = cls.getSuperclass();
        while (superclass != null) {
            classes.add(superclass);
            superclass = superclass.getSuperclass();
        }
        return classes;
    }
<p>Gets a {@code List} of superclasses for the given class.</p>

@param cls  the class to look up, may be {@code null}
@return the {@code List} of superclasses in order going up from this one
 {@code null} if null input
android/android_framework/base/src/main/java/lang3/ClassUtils.java