public static Class < ? > [ ] getAllSuperClasses ( Class < ? > clz ) { List < Class < ? > > list = new ArrayList <> ( ) ; while ( ( clz = clz . getSuperclass ( ) ) != null ) { list . add ( clz ) ; } return list . toArray ( new Class < ? > [ list . size ( ) ] ) ; }
Get all super classes