public static List < Class < ? > > getAllClasses ( Class < ? > clazz ) { List < Class < ? > > types = new ArrayList <> ( ) ; while ( clazz != null ) { types . add ( clazz ) ; clazz = clazz . getSuperclass ( ) ; } return types ; }
Find all super classes including provided class .