Here you can find the source of getSuperClasses(Class clz, boolean reverseOrder)
public static Class[] getSuperClasses(Class clz, boolean reverseOrder)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Class[] getSuperClasses(Class clz, boolean reverseOrder) { return getSuperClasses(clz, reverseOrder, false); }// ww w. j ava2s .com public static Class[] getSuperClasses(Class clz, boolean reverseOrder, boolean includeObject) { boolean skipObject = !includeObject; List<Class> classes = new ArrayList<Class>(); if (clz != null) { do { clz = clz.getSuperclass(); if (Object.class.equals(clz) && skipObject) continue; if (clz != null) { if (reverseOrder) { classes.add(0, clz); } else { classes.add(clz); } } else { break; } } while (true); } return classes.toArray(new Class[classes.size()]); } }