Here you can find the source of resolveAllSuperclasses(Class type)
public static Class[] resolveAllSuperclasses(Class type)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { /**/* w w w . ja v a 2 s .co m*/ * Resolves all super classes, from top (direct subclass) to down. <code>Object</code> * class is not included in the list. */ public static Class[] resolveAllSuperclasses(Class type) { List<Class> list = new ArrayList<>(); while (true) { type = type.getSuperclass(); if ((type == null) || (type == Object.class)) { break; } list.add(type); } return list.toArray(new Class[0]); } }