Here you can find the source of getSuperClasses(Class> c)
public final static List<Class<?>> getSuperClasses(Class<?> c)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public final static List<Class<?>> getSuperClasses(Class<?> c) { List<Class<?>> classes = new ArrayList<Class<?>>(); classes.add(c);/* w w w.ja v a2s . c o m*/ while (c != null) { c = c.getSuperclass(); if ((c == null) || c.getClass().equals(Object.class)) break; classes.add(c); } return classes; } }